Skip to main content

planContract

@webda/sql


Function: planContract()

planContract(live, db, known?): ContractStep[]

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

What the contract phase can apply: the database compared with the union of the live plans

Pure: the caller describes the database (every table any version, live or retired, ever planned) and decides what to run. A table or column the live plans do not know is only dropped when a retired version planned it (known): anything else in the database is left alone.

Parameters​

live​

LiveSchemaPlan[]

the plans of the running versions, this one included

db​

LiveSchema

the database, as described by the dialect

known?​

RelationalSchemaPlan[] = []

the plans of the retired versions: what they planned and no live version uses is dropped

Returns​

ContractStep[]

the steps, drops first, then NOT NULL, then validations