Skip to main content

diffSnapshot

@quik/database


@quik/database / diffSnapshot

Function: diffSnapshot()

diffSnapshot(previous, current): QSchemaChange[]

Defined in: database/src/migrations/snapshot/diff.ts:18

Computes the changes needed to bring previous up to date with current.

Tables and columns present in current but not previous are additions; present in previous but not current are removals; present in both with different QColumnOptions are alterations. Order: new tables, then column changes on existing tables (additions, alterations, removals), then dropped tables last.

Parameters​

previous​

QSchemaSnapshot

Last known schema state (from the stored snapshot, or emptySnapshot if none exists).

current​

QSchemaSnapshot

Schema state derived from the currently registered @Model() classes.

Returns​

QSchemaChange[]