deliveryConflictIdidentifierrequiredWhat identifies the conflict
Becomes the column delivery_conflict_id of delivery_conflict.
Written at commons/data/models/flow/mod.ts:156
A delivery that had the id of one already taken and other content: the original is kept and this is queued to be decided
Model flow. Written in commons/data/models/flow/mod.ts:153. Identified by deliveryConflictId.
deliveryConflictIdidentifierrequiredWhat identifies the conflict
Becomes the column delivery_conflict_id of delivery_conflict.
Written at commons/data/models/flow/mod.ts:156
incomingSha256textrequiredThe SHA-256 of the content that conflicts
Becomes the column incoming_sha_256 of delivery_conflict.
Written at commons/data/models/flow/mod.ts:157
seenAtinstantrequiredWhen it was seen
Becomes the column seen_at of delivery_conflict.
Written at commons/data/models/flow/mod.ts:159
statuscode of conflictStatusrequiredWhere it is
Becomes the column status of delivery_conflict.
Written at commons/data/models/flow/mod.ts:158
deliveryoneThe message it conflicts with To delivery. Written at commons/data/models/flow/mod.ts:153
loadoneThe load that brought it To load. Written at commons/data/models/flow/mod.ts:153
Projects to the table delivery_conflict with the primary key delivery_conflict_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
delivery_conflict_id | text | false | attribute | deliveryConflict.deliveryConflictId |
delivery_id | text | false | reference | deliveryConflict.delivery |
incoming_sha_256 | text | false | attribute | deliveryConflict.incomingSha256 |
load_id | text | false | reference | deliveryConflict.load |
seen_at | timestamp | false | attribute | deliveryConflict.seenAt |
status | text | false | attribute | deliveryConflict.status |
CREATE TABLE IF NOT EXISTS "delivery_conflict" (
"delivery_conflict_id" VARCHAR NOT NULL PRIMARY KEY,
"incoming_sha_256" VARCHAR NOT NULL,
"status" VARCHAR NOT NULL,
"seen_at" TIMESTAMPTZ NOT NULL,
"delivery_id" VARCHAR NOT NULL,
"load_id" VARCHAR NOT NULL,
CONSTRAINT "delivery_conflict_delivery_id_fk" FOREIGN KEY ("delivery_id") REFERENCES "delivery" ("delivery_id"),
CONSTRAINT "delivery_conflict_load_id_fk" FOREIGN KEY ("load_id") REFERENCES "load" ("load_id"),
CONSTRAINT "delivery_conflict_status_ck" CHECK ("status" IN ('open', 'kept', 'replaced'))
);CREATE TABLE IF NOT EXISTS "delivery_conflict" (
"delivery_conflict_id" TEXT NOT NULL PRIMARY KEY,
"incoming_sha_256" TEXT NOT NULL,
"status" TEXT NOT NULL,
"seen_at" TIMESTAMPTZ NOT NULL,
"delivery_id" TEXT NOT NULL,
"load_id" TEXT NOT NULL,
CONSTRAINT "delivery_conflict_delivery_id_fk" FOREIGN KEY ("delivery_id") REFERENCES "delivery" ("delivery_id"),
CONSTRAINT "delivery_conflict_load_id_fk" FOREIGN KEY ("load_id") REFERENCES "load" ("load_id"),
CONSTRAINT "delivery_conflict_status_ck" CHECK ("status" IN ('open', 'kept', 'replaced'))
);CREATE TABLE IF NOT EXISTS "delivery_conflict" (
"delivery_conflict_id" TEXT NOT NULL PRIMARY KEY,
"incoming_sha_256" TEXT NOT NULL,
"status" TEXT NOT NULL,
"seen_at" TEXT NOT NULL,
"delivery_id" TEXT NOT NULL,
"load_id" TEXT NOT NULL,
CONSTRAINT "delivery_conflict_delivery_id_fk" FOREIGN KEY ("delivery_id") REFERENCES "delivery" ("delivery_id"),
CONSTRAINT "delivery_conflict_load_id_fk" FOREIGN KEY ("load_id") REFERENCES "load" ("load_id"),
CONSTRAINT "delivery_conflict_status_ck" CHECK ("status" IN ('open', 'kept', 'replaced'))
);Read and written from TypeScript with the types the model gives: import { deliveryConflict } 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 { deliveryConflict } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(deliveryConflict).select((s) => ({ deliveryConflictId: s.deliveryConflict.deliveryConflictId, incomingSha_256: s.deliveryConflict.incomingSha_256 })).run(runner);