CLIError codes
MIGRATION_CHECKSUM_MISMATCH
A plugin's migration changed after it was generated or after it was applied.
Cause
A plugin's migration changed after it was generated or after it was applied.
Each plugin migration module is sealed with a checksum. A module changed after it was generated no longer matches its seal; a module changed after it was applied no longer describes what ran on the database. Either way the run stops before applying anything. The What line names the plugin and the module.
Fix
- For a module edited by hand, reseal it with
migrationChecksumfrom@nextlyhq/plugin-sdk/schema, or regenerate it withnextly migrate:create --plugin <entry>. - For a module already applied, restore it as it was when it ran, and put the change in a new module.
See Plugin schema.
Example
✗ Plugin "@acme/seo" migration 20261020_120000_add_redirects: a plugin migration has been changed since it was generated.
Why: An edited module is refused rather than re-hashed, so the SQL that runs is the SQL that was reviewed. Nothing was applied.
Next: Regenerate it, or restore the original. A module written or edited by hand is sealed with `migrationChecksum` from `@nextlyhq/plugin-sdk/schema` — `checksum: migrationChecksum(content)` over the module without its checksum — which is the form `nextly migrate:create --plugin <entry> --blank` and `--no-transaction` write.
Docs: https://nextlyhq.com/docs/cli/errors/migration-checksum-mismatch (MIGRATION_CHECKSUM_MISMATCH)