Skip to main content

ContractStep

@webda/sql


Type Alias: ContractStep

ContractStep = { column: string; kind: "dropColumn"; table: string; } | { kind: "dropTable"; table: string; } | { column: string; kind: "setNotNull"; table: string; } | { constraint: string; kind: "validateForeignKey"; table: string; }

Defined in: packages/sql/src/relational/contract.ts:13

One change of the contract phase: what the schema can lose or tighten once no live version depends on it

  • dropColumn: no live version reads or writes the column
  • dropTable: no live version uses the table (a model table or a junction)
  • setNotNull: every live version writes the column (a field or a reference) and requires it; applied only when no row is null
  • validateForeignKey: a foreign key added NOT VALID by alter