IF Commons GitHub

issueSync

concept

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.

Governance: attributes

insertedintegerrequired

How many records it added

Becomes the column inserted of issue_sync.

Written at commons/data/models/issues/mod.ts:138

issueSyncIdidentifierrequired

What identifies the synchronisation

Becomes the column issue_sync_id of issue_sync.

Written at commons/data/models/issues/mod.ts:133

outcomecode of issueSyncOutcomerequired

What it did

Becomes the column outcome of issue_sync.

Written at commons/data/models/issues/mod.ts:137

ranAtinstantrequired

When it ran

Becomes the column ran_at of issue_sync.

Written at commons/data/models/issues/mod.ts:136

reopenedintegerrequired

How many that were withdrawn it brought back

Becomes the column reopened of issue_sync.

Written at commons/data/models/issues/mod.ts:141

scopetextrequired

The scope synchronised

Becomes the column scope of issue_sync.

Written at commons/data/models/issues/mod.ts:134

sourceHashtextrequired

A 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

updatedintegerrequired

How many it changed

Becomes the column updated of issue_sync.

Written at commons/data/models/issues/mod.ts:139

withdrawnintegerrequired

How 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

Logical: the table

Projects to the table issue_sync with the primary key issue_sync_id.

ColumnTypeNullRoleFrom
insertedintegerfalseattributeissueSync.inserted
issue_sync_idtextfalseattributeissueSync.issueSyncId
outcometextfalseattributeissueSync.outcome
ran_attimestampfalseattributeissueSync.ranAt
reopenedintegerfalseattributeissueSync.reopened
scopetextfalseattributeissueSync.scope
source_hashtextfalseattributeissueSync.sourceHash
updatedintegerfalseattributeissueSync.updated
withdrawnintegerfalseattributeissueSync.withdrawn

Physical: SQL

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'))
);

Physical: the typed table

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);

Titles, headings, exports, tables, columns and requirements. Esc closes.