classificationtextoptionalHow sensitive it is: public, internal, confidential or restricted
Becomes the column classification of contract_field.
Written at commons/data/models/contract/mod.ts:80
One field a data contract promises: its name, its datatype, whether it may be missing and how it is classified
Model contract. Written in commons/data/models/contract/mod.ts:73. Identified by contractFieldId.
classificationtextoptionalHow sensitive it is: public, internal, confidential or restricted
Becomes the column classification of contract_field.
Written at commons/data/models/contract/mod.ts:80
contractFieldIdidentifierrequiredWhat identifies the field: its contract and name
Becomes the column contract_field_id of contract_field.
Written at commons/data/models/contract/mod.ts:76
datatypetextrequiredThe datatype, as the contract names it
Becomes the column datatype of contract_field.
Written at commons/data/models/contract/mod.ts:78
fieldNametextrequiredThe name of the field
Becomes the column field_name of contract_field.
Written at commons/data/models/contract/mod.ts:77
nullablebooleanrequiredWhether it may be missing
Becomes the column nullable of contract_field.
Written at commons/data/models/contract/mod.ts:79
contractoneThe contract it is a field of To dataContract. Written at commons/data/models/contract/mod.ts:73
Projects to the table contract_field with the primary key contract_field_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
classification | text | true | attribute | contractField.classification |
contract_data_contract_id | text | false | reference | contractField.contract |
contract_field_id | text | false | attribute | contractField.contractFieldId |
datatype | text | false | attribute | contractField.datatype |
field_name | text | false | attribute | contractField.fieldName |
nullable | boolean | false | attribute | contractField.nullable |
CREATE TABLE IF NOT EXISTS "contract_field" (
"contract_field_id" VARCHAR NOT NULL PRIMARY KEY,
"field_name" VARCHAR NOT NULL,
"datatype" VARCHAR NOT NULL,
"nullable" BOOLEAN NOT NULL,
"classification" VARCHAR,
"contract_data_contract_id" VARCHAR NOT NULL,
CONSTRAINT "contract_field_contract_data_contract_id_fk" FOREIGN KEY ("contract_data_contract_id") REFERENCES "data_contract" ("data_contract_id"),
CONSTRAINT "contract_field_contract_data_contract_id_field_name_uq" UNIQUE ("contract_data_contract_id", "field_name")
);CREATE TABLE IF NOT EXISTS "contract_field" (
"contract_field_id" TEXT NOT NULL PRIMARY KEY,
"field_name" TEXT NOT NULL,
"datatype" TEXT NOT NULL,
"nullable" BOOLEAN NOT NULL,
"classification" TEXT,
"contract_data_contract_id" TEXT NOT NULL,
CONSTRAINT "contract_field_contract_data_contract_id_fk" FOREIGN KEY ("contract_data_contract_id") REFERENCES "data_contract" ("data_contract_id"),
CONSTRAINT "contract_field_contract_data_contract_id_field_name_uq" UNIQUE ("contract_data_contract_id", "field_name")
);CREATE TABLE IF NOT EXISTS "contract_field" (
"contract_field_id" TEXT NOT NULL PRIMARY KEY,
"field_name" TEXT NOT NULL,
"datatype" TEXT NOT NULL,
"nullable" INTEGER NOT NULL,
"classification" TEXT,
"contract_data_contract_id" TEXT NOT NULL,
CONSTRAINT "contract_field_contract_data_contract_id_fk" FOREIGN KEY ("contract_data_contract_id") REFERENCES "data_contract" ("data_contract_id"),
CONSTRAINT "contract_field_contract_data_contract_id_field_name_uq" UNIQUE ("contract_data_contract_id", "field_name")
);Read and written from TypeScript with the types the model gives: import { contractField } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/contract.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { contractField } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(contractField).select((s) => ({ contractFieldId: s.contractField.contractFieldId, fieldName: s.contractField.fieldName })).run(runner);