انتقل إلى المحتوى الرئيسي

Function: sqlFileMigrations()

sqlFileMigrations(directories, first?, shared?): MigrationProvider

Defined in: packages/persistence/src/migrate.ts:39

Reads plain SQL files from directories and offers them to Kysely in name order. There is no down migration: a mistake is fixed by a new migration, which is how the audit trail of the schema stays forward-only. Each file runs in its own transaction.

Parameters​

directories​

readonly string[]

Shared first, then the module's own.

first?​

number = FIRST_MODULE_MIGRATION

The number below which a directory other than a shared one may not go.

shared?​

readonly string[] = ...

Directories that carry the shared range: this package's own, plus any shared package's that the caller names.

Returns​

MigrationProvider

A provider for Migrator.

Throws​

bad_migration for a malformed or duplicate name, or a module file numbered into the shared range.