Build the new public staff directory and audited Great Migration appointments

This commit is contained in:
unimatrixgit 2026-11-15 02:31:58 +01:00
commit fc9549ee71

View file

@ -3,11 +3,8 @@ import {existsSync} from 'node:fs';
import {syncNativeAgents} from './native-agents.mjs';
// One coalesced change event. Retrying this table never polls accounts or ranks.
export const NATIVE_SYNC_SCHEMA=`CREATE TABLE IF NOT EXISTS native_sync_outbox (
job_key VARCHAR(32) PRIMARY KEY, revision CHAR(36) NOT NULL, attempts INTEGER NOT NULL,
next_attempt_at BIGINT NOT NULL, lease_token CHAR(36) NOT NULL, lease_until BIGINT NOT NULL,
created_at BIGINT NOT NULL, last_error VARCHAR(80) NOT NULL
)`;
import {NATIVE_SYNC_SCHEMA} from './native-sync-schema.mjs';
export {NATIVE_SYNC_SCHEMA} from './native-sync-schema.mjs';
export async function initializeNativeSyncOutbox(db){await db.prepare(NATIVE_SYNC_SCHEMA).run();}
export function nativeSyncChange(db,now=Date.now()){
return db.prepare("INSERT INTO native_sync_outbox(job_key,revision,attempts,next_attempt_at,lease_token,lease_until,created_at,last_error) VALUES('memberships',?,0,0,'',0,?,'') ON CONFLICT(job_key) DO UPDATE SET revision=excluded.revision,attempts=0,next_attempt_at=0,created_at=excluded.created_at,last_error='' ").bind(randomUUID(),now);