meaningtextrequiredWhat it means, in a sentence
Becomes the column meaning of reason.
Written at commons/data/models/flow/mod.ts:77
A reason code that says why a stage stopped, rejected or lost something, so that no loss is unexplained
Model flow. Written in commons/data/models/flow/mod.ts:77. Identified by reasonId.
meaningtextrequiredWhat it means, in a sentence
Becomes the column meaning of reason.
Written at commons/data/models/flow/mod.ts:77
producedBycode of producerrequiredWho produces it
Becomes the column producer_code of reason.
Written at commons/data/models/flow/mod.ts:77
reasonIdidentifierrequiredWhat identifies the reason: its code
Becomes the column reason_id of reason.
Written at commons/data/models/flow/mod.ts:77
stagecode of stageoptionalThe stage it is of, where it is of one
Becomes the column stage of reason.
Written at commons/data/models/flow/mod.ts:107
Projects to the table reason with the primary key reason_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
meaning | text | false | attribute | reason.meaning |
producer_code | text | false | reference | reason.producedBy |
reason_id | text | false | attribute | reason.reasonId |
stage | text | true | attribute | reason.stage |
CREATE TABLE IF NOT EXISTS "reason" (
"reason_id" VARCHAR NOT NULL PRIMARY KEY,
"meaning" VARCHAR NOT NULL,
"producer_code" VARCHAR NOT NULL,
"stage" VARCHAR,
CONSTRAINT "reason_producer_code_fk" FOREIGN KEY ("producer_code") REFERENCES "producer" ("code"),
CONSTRAINT "reason_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);CREATE TABLE IF NOT EXISTS "reason" (
"reason_id" TEXT NOT NULL PRIMARY KEY,
"meaning" TEXT NOT NULL,
"producer_code" TEXT NOT NULL,
"stage" TEXT,
CONSTRAINT "reason_producer_code_fk" FOREIGN KEY ("producer_code") REFERENCES "producer" ("code"),
CONSTRAINT "reason_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);CREATE TABLE IF NOT EXISTS "reason" (
"reason_id" TEXT NOT NULL PRIMARY KEY,
"meaning" TEXT NOT NULL,
"producer_code" TEXT NOT NULL,
"stage" TEXT,
CONSTRAINT "reason_producer_code_fk" FOREIGN KEY ("producer_code") REFERENCES "producer" ("code"),
CONSTRAINT "reason_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);Read and written from TypeScript with the types the model gives: import { reason } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/flow.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { reason } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(reason).select((s) => ({ reasonId: s.reason.reasonId, meaning: s.reason.meaning })).run(runner);