Migration errors
Thrown as MigrationError (code: "migration"), from egon-orm/migration. Each entry is an identifier (error.id), then the message as the error states it, where {expression} stands for the value of that expression in the source ({…} for one too long to show), then what to do about it: the text useFullErrorMessages(messages) and explain(error) add, where {name} stands for the error's parameter of that name. See Errors.
migration.buildFailed
Migration {source.version}_{source.name}: {causeText(error)}
The cause is the error the migration's up() or down() threw while it described its statements; fix the migration.
migration.changeNotSupported
{subject} {what}.
change() is not supported: write the change in up(m) and what undoes it in down(m).
migration.concurrentIndexInTransaction
Migration {source.version}_{source.name} builds or drops an index concurrently, which cannot run inside a transaction.
Add transaction: false to its defineMigration().
migration.constantType
A constant in DDL must be a string, a finite number, a bigint, a boolean or null.
Pass a string, a finite number, a bigint, a boolean or null.
migration.customTypeSql
A custom column type's sql is not a plain type name, so it was not written.
Give the custom type a plain SQL type name, such as "citext" or "numeric(10, 2)".
migration.ddlParams
{what} cannot bind values: DDL takes no parameters.
Write the constant in the template text, or use fragment.ident() for a name.
migration.dialectUnsupported
Migrations are not supported on {String(dialect)} by this build of egon-orm: it has no migration dialect table for it.
Migrations are not supported on {String(adapter.dialect)} by this build of egon-orm.
See Dialect support for the databases migrations run on.
migration.failed
Migration {source.version}_{source.name} {outcome}: {message}{stuck}
The cause is the database's error, and sql the statement that failed. Fix the migration and run it again; what stays applied is said above.
migration.featureUnsupported
{where} is not supported on {String(adapter.dialect)} by this build of egon-orm.
See Dialect support for what each database supports.
migration.fileName
The migration file "{file}" does not start with a 14-digit version (YYYYMMDDHHMMSS).
Rename it, for example "20261012093000_{match}.{match1}".
migration.generatedKeyAlone
The generated key "{column.name}" must be the table's only key column on {ctx.dialect.name}.
Make the generated key the table's only key column, or give it a plain integer type.
migration.indexMethod
The index method "{using}" is not one {ctx.dialect.name} has; it has {ctx.dialect.features.indexMethods.join(", ")}.
Use one of the methods the database has, or write the statement with m.sql`…`.
migration.loadFailed
Cannot load the migration file "{path}"{reason}
The cause is the error importing the file threw; fix the file, or the migration it defines.
migration.lockTimeout
Gave up waiting for the migration lock after {lockTimeoutMs} ms: another runner is migrating the same database (tracking table "{this.#settings.table.name}").
Wait for the other runner to finish, or give a larger lockTimeoutMs.
migration.lockTimeoutClaimed
Gave up waiting for the migration lock after {lockTimeoutMs} ms: another runner is migrating the same database (tracking table "{this.#settings.table.name}").
If no runner is running, one stopped while it ran a migration without a transaction: check what that migration did, then delete the row with version {claim} from "{table}".
migration.missingSteps
{subject} {what}.
A migration has both up(m) and down(m); when there is nothing to undo, write down() {} with a // noop comment.
migration.modifyWhole
{ctx.dialect.name} changes a column by writing it whole (MODIFY COLUMN), and modify() of "{change.column}" does not give both notNull and default.
Give modify() both notNull and default (null for none) for "{column}".
migration.noExport
The migration file "{path}" exports no migration.
Export the result of defineMigration() as "migration" (export const migration = defineMigration(…)) or as the default export.
migration.numberConstant
A number constant in DDL must be finite.
Pass a finite number.
migration.readDirectory
Cannot read the migrations directory "{root}".
Check that the directory exists and can be read; the cause has the system's error.
migration.rollbackMissingFile
Cannot roll back past version {version}: it is recorded as applied, but there is no migration with that version.
Restore its file, or remove the version from the tracking table if it is really gone.
migration.stringConstant
A string constant in DDL cannot hold a NUL character or a lone surrogate.
Remove the NUL character or lone surrogate from the string.
migration.timestampColumn
The tracking table "{table.name}" has no column "{timestampColumn}".
If it was created by another tool, pass its timestamp column: createMigrator({ timestampColumn: "inserted_at" }) (or whatever it is called).
migration.trackingVersion
The tracking table "{table.name}" holds a version that is not a safe whole number: {String(row.version)}.
Fix the row in the tracking table: versions are 14-digit whole numbers (YYYYMMDDHHMMSS).
migration.transactionLeftOpen
it opened a transaction and did not end it (a begin without a commit).
End every transaction a migration opens with m.sql`commit` (or let the runner wrap it: leave transaction: false out).
migration.typescriptLoader
Cannot load the TypeScript migration "{file}": this process has no TypeScript loader.
Run it with one: Node 22.18 or later strips types by itself (on 22.12 to 22.17 set NODE_OPTIONS=--experimental-strip-types, as in NODE_OPTIONS=--experimental-strip-types npx egon migrate), or use tsx (NODE_OPTIONS="--import tsx"), or Bun. Or compile the migrations to .js.
migration.unsupportedFeature
{feature} is not supported by {ctx.dialect.name}.
See Dialect support for what {dialect} supports; m.sql`…` can run any statement the builder has no method for.
migration.versionTwice
Two migrations have the version {current.version}: "{previous.name}" and "{current.name}".
Give one of them a new version.

