SQLMigrator.migrate()method
Run each statement from getMigrations() against the provider in order.
migrate(...collections: Collections<number>): Promise<void>
new SQLMigrator<T>()
| Return | |
|---|---|
SQLMigrator<T> | Shared SQL migration logic that diffs collection schemas against live tables to produce migration statements. |
Shared SQL migration logic that diffs collection schemas against live tables to produce migration statements.
Run each statement from getMigrations() against the provider in order.
migrate(...collections: Collections<number>): Promise<void>
Compute the SQL statements needed to bring the tables into line with the given collection schemas, without executing them.
getMigrations(...collections: Collections<number>): Promise<readonly string[]>
Build the CREATE TABLE statement for a collection, including its ID, data, and generated columns.
getCreateTableQuery(collection: Collection<string, number, T>): string
Get the full set of columns for a collection's table: the ID column, data column, and generated columns.
getCreateTableColumns(collection: Collection<string, number, T>): readonly SQLTableColumn[]
Get the generated (computed) columns for a collection's table, derived from its schema's scalar properties.
getGeneratedTableColumns(collection: Collection<string, number, T>): readonly SQLTableColumn[]