Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | db/migrations/0038_connector_sync_state.sql |
| Original SHA-256 | 40cf3ac1674e73c3c27611cf2daa15e4eeab1435b91f940edeabfb524294774e |
| Git blob SHA | 01676088525ac04d0a2b26336251b3bf8d43c35c |
| Reading-copy SHA-256 | 40cf3ac1674e73c3c27611cf2daa15e4eeab1435b91f940edeabfb524294774e |
Every recorded occurrence
These 9 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / db/migrations/0038_connector_sync_state.sql | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓30 lines · 2.0 KB
-- +goose Up
-- The enterprise connector incremental sync cursor. One row per (organization, connector), holding the
-- watermark (the max updated timestamp ingested so far) so each sync pulls only records changed since the last
-- run, plus lightweight run bookkeeping. It is the state behind the iCIMS ATS and Workday HRIS connectors that
-- flow a consenting pilot tenant's live workforce data into the candidates table through the proven sourcing
-- ingest path. Tenant scoped and RLS forced like every tenant table: a connector cursor can never leak or be
-- written across orgs. The app role reads and writes its own org's cursor (the sync command runs as the app
-- role under a tenant tx); it never deletes one.
CREATE TABLE connector_sync_state (
organization_id uuid NOT NULL REFERENCES organizations(id),
connector_name text NOT NULL, -- the stable connector id, e.g. icims or workday
watermark timestamptz NOT NULL DEFAULT '1970-01-01T00:00:00Z', -- max updated ts ingested; the incremental window floor
last_run_at timestamptz, -- when the connector last ran for this org
records_synced bigint NOT NULL DEFAULT 0, -- cumulative records ingested, for operator visibility
PRIMARY KEY (organization_id, connector_name)
);
ALTER TABLE connector_sync_state ENABLE ROW LEVEL SECURITY;
ALTER TABLE connector_sync_state FORCE ROW LEVEL SECURITY;
CREATE POLICY connector_sync_state_isolation ON connector_sync_state
USING (organization_id = NULLIF(current_setting('app.current_org_id', true), '')::uuid)
WITH CHECK (organization_id = NULLIF(current_setting('app.current_org_id', true), '')::uuid);
-- The app role reads its cursor, inserts it on the first run, and advances it each run. It never deletes a
-- cursor (a sync watermark is operational state, not a record to purge in app code).
GRANT SELECT, INSERT, UPDATE ON connector_sync_state TO missionmatch_app;
-- +goose Down
DROP TABLE IF EXISTS connector_sync_state;