Function: migrate()
migrate(
config,schema,directories?,shared?):Promise<MigrationReport>
Defined in: packages/persistence/src/migrate.ts:98
Applies pending migrations under the module's OWNER role (identity_owner, never
the runtime _app role) and closes the connection. The role's search_path is the
module's schema, so unqualified CREATE TABLE lands there, and the migration
history table is kept in that schema too: one history per module.
Concurrent runs are serialised by Kysely's migration lock.
Parameters
config
The OWNER role's connection. pool.max is clamped to 1.
schema
string
The module's schema, where the history table lives.
directories?
readonly string[] = ...
Shared first, then the module's own.
shared?
readonly string[] = ...
Which of directories carry the shared range; default this package's.
Returns
Promise<MigrationReport>
The names applied.
Throws
A migration failed; it was rolled back and the next not attempted.