IF Commons GitHub

promotion

concept

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.

Governance: attributes

evidenceReftextoptional

The evidence for it

Becomes the column evidence_ref of promotion.

Written at commons/data/models/operations/mod.ts:130

promotionIdidentifierrequired

What identifies the promotion

Becomes the column promotion_id of promotion.

Written at commons/data/models/operations/mod.ts:130

Governance: relationships

releaseone

What was promoted To release. Written at commons/data/models/operations/mod.ts:130

targetone

Where it went To runtimeEnvironment. Written at commons/data/models/operations/mod.ts:130

Logical: the table

Projects to the table promotion with the primary key promotion_id.

ColumnTypeNullRoleFrom
evidence_reftexttrueattributepromotion.evidenceRef
promoted_attimestampfalseattributepromotion.promotedAt
promoted_bytextfalseattributepromotion.promotedBy
promotion_idtextfalseattributepromotion.promotionId
release_idtextfalsereferencepromotion.release
target_runtime_environment_idtextfalsereferencepromotion.target

Physical: SQL

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

Physical: the typed table

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

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