Skip to main content

planSchemaChanges

@webda/sql


Function: planSchemaChanges()

planSchemaChanges(plan, live, mode, options?): object

Defined in: packages/sql/src/relational/sync.ts:113

The additive changes bringing the database to the plan, and the differences that are never resolved

Nothing destructive is ever planned: no drop, no type change, no NOT NULL. In create mode the changes of an existing table are reported as drift instead of planned.

Parameters​

plan​

RelationalSchemaPlan

the plan

live​

LiveSchema

the database as described by the dialect

mode​

"create" | "alter"

create or alter

options?​

planner options

inlineForeignKeys?​

boolean

the engine declares the foreign keys inside CREATE TABLE and cannot add one later

Returns​

object

the steps in application order (tables, columns, indexes, foreign keys), the ones on an existing table flagged online, and the drift

drift​

drift: SchemaDrift[]

steps​

steps: SchemaStep[]