evidenceReftextoptionalThe evidence for it
Becomes the column evidence_ref of promotion.
Written at commons/data/models/operations/mod.ts:130
A release arriving in an environment, with who promoted it, when and the evidence: the promotion log, only ever added to
Model operations. Written in commons/data/models/operations/mod.ts:130. Identified by promotionId.
evidenceReftextoptionalThe evidence for it
Becomes the column evidence_ref of promotion.
Written at commons/data/models/operations/mod.ts:130
promotedAtinstantrequiredWhen
Becomes the column promoted_at of promotion.
Written at commons/data/models/operations/mod.ts:130
promotedBytextrequiredWho did it
Becomes the column promoted_by of promotion.
Written at commons/data/models/operations/mod.ts:130
promotionIdidentifierrequiredWhat identifies the promotion
Becomes the column promotion_id of promotion.
Written at commons/data/models/operations/mod.ts:130
releaseoneWhat was promoted To release. Written at commons/data/models/operations/mod.ts:130
targetoneWhere it went To runtimeEnvironment. Written at commons/data/models/operations/mod.ts:130
Projects to the table promotion with the primary key promotion_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
evidence_ref | text | true | attribute | promotion.evidenceRef |
promoted_at | timestamp | false | attribute | promotion.promotedAt |
promoted_by | text | false | attribute | promotion.promotedBy |
promotion_id | text | false | attribute | promotion.promotionId |
release_id | text | false | reference | promotion.release |
target_runtime_environment_id | text | false | reference | promotion.target |
CREATE TABLE IF NOT EXISTS "promotion" (
"promotion_id" VARCHAR NOT NULL PRIMARY KEY,
"promoted_by" VARCHAR NOT NULL,
"promoted_at" TIMESTAMPTZ NOT NULL,
"evidence_ref" VARCHAR,
"release_id" VARCHAR NOT NULL,
"target_runtime_environment_id" VARCHAR NOT NULL,
CONSTRAINT "promotion_release_id_fk" FOREIGN KEY ("release_id") REFERENCES "release" ("release_id"),
CONSTRAINT "promotion_target_runtime_environment_id_fk" FOREIGN KEY ("target_runtime_environment_id") REFERENCES "runtime_environment" ("runtime_environment_id")
);CREATE TABLE IF NOT EXISTS "promotion" (
"promotion_id" TEXT NOT NULL PRIMARY KEY,
"promoted_by" TEXT NOT NULL,
"promoted_at" TIMESTAMPTZ NOT NULL,
"evidence_ref" TEXT,
"release_id" TEXT NOT NULL,
"target_runtime_environment_id" TEXT NOT NULL,
CONSTRAINT "promotion_release_id_fk" FOREIGN KEY ("release_id") REFERENCES "release" ("release_id"),
CONSTRAINT "promotion_target_runtime_environment_id_fk" FOREIGN KEY ("target_runtime_environment_id") REFERENCES "runtime_environment" ("runtime_environment_id")
);CREATE TABLE IF NOT EXISTS "promotion" (
"promotion_id" TEXT NOT NULL PRIMARY KEY,
"promoted_by" TEXT NOT NULL,
"promoted_at" TEXT NOT NULL,
"evidence_ref" TEXT,
"release_id" TEXT NOT NULL,
"target_runtime_environment_id" TEXT NOT NULL,
CONSTRAINT "promotion_release_id_fk" FOREIGN KEY ("release_id") REFERENCES "release" ("release_id"),
CONSTRAINT "promotion_target_runtime_environment_id_fk" FOREIGN KEY ("target_runtime_environment_id") REFERENCES "runtime_environment" ("runtime_environment_id")
);Read and written from TypeScript with the types the model gives: import { promotion } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/operations.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { promotion } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(promotion).select((s) => ({ promotionId: s.promotion.promotionId, promotedBy: s.promotion.promotedBy })).run(runner);