insertedintegerrequiredHow many records it added
Becomes the column inserted of issue_sync.
Written at commons/data/models/issues/mod.ts:138
One synchronisation of the records with the code, kept as a ledger
Model issues. Written in commons/data/models/issues/mod.ts:130. Identified by issueSyncId.
insertedintegerrequiredHow many records it added
Becomes the column inserted of issue_sync.
Written at commons/data/models/issues/mod.ts:138
issueSyncIdidentifierrequiredWhat identifies the synchronisation
Becomes the column issue_sync_id of issue_sync.
Written at commons/data/models/issues/mod.ts:133
outcomecode of issueSyncOutcomerequiredWhat it did
Becomes the column outcome of issue_sync.
Written at commons/data/models/issues/mod.ts:137
ranAtinstantrequiredreopenedintegerrequiredHow many that were withdrawn it brought back
Becomes the column reopened of issue_sync.
Written at commons/data/models/issues/mod.ts:141
scopetextrequiredThe scope synchronised
Becomes the column scope of issue_sync.
Written at commons/data/models/issues/mod.ts:134
sourceHashtextrequiredA hash of the issues of the code at the time
Becomes the column source_hash of issue_sync.
Written at commons/data/models/issues/mod.ts:135
updatedintegerrequiredHow many it changed
Becomes the column updated of issue_sync.
Written at commons/data/models/issues/mod.ts:139
withdrawnintegerrequiredHow many it marked as no longer in the code
Becomes the column withdrawn of issue_sync.
Written at commons/data/models/issues/mod.ts:140
Projects to the table issue_sync with the primary key issue_sync_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
inserted | integer | false | attribute | issueSync.inserted |
issue_sync_id | text | false | attribute | issueSync.issueSyncId |
outcome | text | false | attribute | issueSync.outcome |
ran_at | timestamp | false | attribute | issueSync.ranAt |
reopened | integer | false | attribute | issueSync.reopened |
scope | text | false | attribute | issueSync.scope |
source_hash | text | false | attribute | issueSync.sourceHash |
updated | integer | false | attribute | issueSync.updated |
withdrawn | integer | false | attribute | issueSync.withdrawn |
CREATE TABLE IF NOT EXISTS "issue_sync" (
"issue_sync_id" VARCHAR NOT NULL PRIMARY KEY,
"scope" VARCHAR NOT NULL,
"source_hash" VARCHAR NOT NULL,
"ran_at" TIMESTAMPTZ NOT NULL,
"outcome" VARCHAR NOT NULL,
"inserted" INTEGER NOT NULL,
"updated" INTEGER NOT NULL,
"withdrawn" INTEGER NOT NULL,
"reopened" INTEGER NOT NULL,
CONSTRAINT "issue_sync_outcome_ck" CHECK ("outcome" IN ('synced', 'unchanged'))
);CREATE TABLE IF NOT EXISTS "issue_sync" (
"issue_sync_id" TEXT NOT NULL PRIMARY KEY,
"scope" TEXT NOT NULL,
"source_hash" TEXT NOT NULL,
"ran_at" TIMESTAMPTZ NOT NULL,
"outcome" TEXT NOT NULL,
"inserted" INTEGER NOT NULL,
"updated" INTEGER NOT NULL,
"withdrawn" INTEGER NOT NULL,
"reopened" INTEGER NOT NULL,
CONSTRAINT "issue_sync_outcome_ck" CHECK ("outcome" IN ('synced', 'unchanged'))
);CREATE TABLE IF NOT EXISTS "issue_sync" (
"issue_sync_id" TEXT NOT NULL PRIMARY KEY,
"scope" TEXT NOT NULL,
"source_hash" TEXT NOT NULL,
"ran_at" TEXT NOT NULL,
"outcome" TEXT NOT NULL,
"inserted" INTEGER NOT NULL,
"updated" INTEGER NOT NULL,
"withdrawn" INTEGER NOT NULL,
"reopened" INTEGER NOT NULL,
CONSTRAINT "issue_sync_outcome_ck" CHECK ("outcome" IN ('synced', 'unchanged'))
);Read and written from TypeScript with the types the model gives: import { issueSync } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/issues.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { issueSync } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(issueSync).select((s) => ({ issueSyncId: s.issueSync.issueSyncId, scope: s.issueSync.scope })).run(runner);