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
Let me check how each dialect handles column comments, and how the sqlite platform files are organized.
- Assistant
Now let me look at how the comparator and diff handle a comment-only change on sqlite, and check the SqlitePlatform file:
- Assistant
Test fails as expected. Now the fix — first the platform flag:
- Assistant
Now the SqlitePlatform override:
- Assistant
Now
DatabaseTable.toJSON(): - Assistant
Test passes. Now validate: build, lint, then relevant suites.
- Assistant
No docker in this environment, so DB-backed tests can't run. Let me run the sqlite-based suites, which are what this fix targets:
- Assistant
While the sqlite suite runs, let me verify table-level comments round-trip on sqlite (I left those alone):
- Assistant
All 674 sqlite tests pass. Let me confirm table comments do round-trip on sqlite (justifying leaving table-level
commentuntouched): - Assistant
Now update the test to cover both levels:
- Assistant
While those run, check for any name collision with
supportsComments: - Assistant
While that runs, let me check whether the docs from #7608 warrant a small note:
- Assistant
#7608 also updated the versioned docs — check for the same paragraph there:
- Assistant
Docs updated. Run
yarn formatwhile waiting on the full suite: - Assistant
While waiting, review the final diff:
- Assistant
Both background tasks (the suite itself and a waiter) will notify when done — I'll report the final results then.
- Assistant
The suite's output is redirected to the summary file, so nothing to peek at yet. I'll wait for the completion notification and then report the full results and finish the
yarn formatretry.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.