Interface MigratorProps

Hierarchy

  • MigratorProps

Properties

allowUnorderedMigrations?: boolean

Enforces whether or not migrations must be run in alpha-numeric order.

When false, migrations must be run in their exact alpha-numeric order. This is checked against the migrations already run in the database (`migrationTableName'). This ensures your migrations are always run in the same order and is the safest option.

When true, migrations are still run in alpha-numeric order, but the order is not checked against already-run migrations in the database. Kysely will simply run all migrations that haven't run yet, in alpha-numeric order.

db: Kysely<any>
migrationLockTableName?: string

The name of the internal migration lock table. Defaults to kysely_migration_lock.

If you do specify this, you need to ALWAYS use the same value. Kysely doesn't support changing the table on the fly. If you run the migrator even once with a table name X and then change the table name to Y, kysely will create a new empty lock table.

If you do specify this, ALWAYS ALWAYS use the same value from the beginning of the project, to the end of time or prepare to manually migrate the migration tables.

migrationTableName?: string

The name of the internal migration table. Defaults to kysely_migration.

If you do specify this, you need to ALWAYS use the same value. Kysely doesn't support changing the table on the fly. If you run the migrator even once with a table name X and then change the table name to Y, kysely will create a new empty migration table and attempt to run the migrations again, which will obviously fail.

If you do specify this, ALWAYS ALWAYS use the same value from the beginning of the project, to the end of time or prepare to manually migrate the migration tables.

migrationTableSchema?: string

The schema of the internal migration tables. Defaults to the default schema on dialects that support schemas.

If you do specify this, you need to ALWAYS use the same value. Kysely doesn't support changing the schema on the fly. If you run the migrator even once with a schema name X and then change the schema name to Y, kysely will create a new empty migration tables in the new schema and attempt to run the migrations again, which will obviously fail.

If you do specify this, ALWAYS ALWAYS use the same value from the beginning of the project, to the end of time or prepare to manually migrate the migration tables.

This only works on postgres.

Generated using TypeDoc