orm.migrator.up() rewrites snapshot incorrectly Describe the bug When we run…
- User
orm.migrator.up()rewrites snapshot incorrectlyDescribe the bug
When we run
orm.migrator.up(), the snapshot changes and a bunch of stuff in the snapshot is wrong and we have to revert the changes.Reproduction
https://github.com/zachkirsch/mikro-orm-migrate-snapshot-repro
What driver are you using?
@mikro-orm/sqlite
MikroORM version
7.1.2-dev.10
Node.js version
v24.0.1
Operating system
macOS
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord.
- The provided reproduction is a minimal reproducible example of the bug.
Interface
No new interfaces are introduced.
- Assistant
Now let me check how the existing snapshot round-trip test from #7608 is structured:
- Assistant
Let me verify the issue number the repro README references:
- Assistant
The repro README explicitly links issue #7798, so I can reference it. Now let me write the failing regression test first:
- Assistant
Now let me check the sqlite platform structure and whether other dialects (mssql, oracle) persist comments:
- Assistant
Reproduced exactly. Now the fix — first the platform capability flag:
- Assistant
Both pass. Now run the broader affected suites — migrations and sqlite schema generator:
- Assistant
Failures look like missing database containers. Let me check:
- Assistant
No docker here — only sqlite-based tests can run. Let me run the sqlite-scoped suites:
- Assistant
Let me check whether these failures are pre-existing (DB-dependent) by comparing against a clean tree:
- Assistant
The
custom-type-mappingfailure needs a closer look — it mentions comments: - Assistant
All remaining failures are DB connections (no docker available). Now run libsql tests, then build and lint:
- Assistant
All checks pass. Let me review the final diff:
- Assistant
One final targeted re-run to confirm everything is green:
- Assistant
Done. The fix is implemented and verified.
Root cause
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.