ErrorsEntities, stores and migrations · rule
migration.record_invalid
A file in a migration's folder is missing, can't be read, or was changed by hand, so Jadpo can't use the migration.
Area 5, Entities, stores and migrations; not declinable; the next step is usually the human's.
Why Jadpo refuses it
jadpo migrate new writes each migration's folder: snapshot.json, the
whole schema at that point, and postgres.sql, the SQL that gets there.
jadpo check compares the entities with the latest snapshot, and the
next migration is worked out from it. A record that can't be read breaks
both, and a guess at what it held could change a real database in a way
nobody wrote.
Jadpo won't rebuild the file for you. The right content is the one that was committed, and that may already have been applied to a database.
What it looks like
A project whose first migration's snapshot was edited by hand:
database/migrations/20261020T1400_initial/snapshot.json:
{"format": 1} error database/migrations/20261020T1400_initial/snapshot.json can't be read
--> database/migrations/20261020T1400_initial/snapshot.json
- reason
- A migration's records are written by
jadpo migrate newand never edited by hand; this one can't be used: it has nostoresobject. - next
- Restore it from version control (human)
- rule
- migration.
record_ invalid - help
- https://jadpo.
dev/docs/errors/migration. record_ invalid
(human) at the end of the next: line tells your coding agent to stop
and ask you which fix you want, because the choice is yours to make: it
decides which committed version of the migration your databases are
compared with.
How to fix it
If the file was committed, bring back the committed version:
git restore database/migrations/20261020T1400_initial/snapshot.jsonThe snapshot again matches what jadpo migrate new wrote, so
jadpo check can compare the entities with it, and the next migration
starts from it.
A migration's files are never fixed by hand, since jadpo migrate new
is the only thing that writes them.
Related
Markdown for agents: /docs/errors/migration.record_invalid.md.Built from Jadpo main at aee2e8f.