ISSUE DESCRIPTION orm.migrator.up() rewrites snapshot incorrectly Describe the bug When…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. Assistant
Now let me write a temp reproduction test.
Assistant
Now let me implement the fix in the Migrator.
Assistant
Now add the
SchemaComparatorimport.Assistant
Now override in SqlitePlatform and use it in DatabaseTable/SchemaComparator.
Assistant
Now update the SchemaComparator to skip column comment diffs on platforms without support.
Assistant
Now add the
#platformKeepsLengthprivate method.Assistant
Now let me implement table comment introspection for sqlite.
Assistant
Now update DatabaseTable (both column and table comments) and the comparator.
Assistant
Now the table-level comment in toJSON:
Assistant
Now update the comparator (column + table comment) to use
supportsComments().Assistant
Now reorder so
typeParamsis computed beforehasMeaningfulLength:Assistant
Now let me re-verify with a comprehensive temp test including
time(3)on sqlite.Assistant
I've completed the fix. Let me do a final verification run before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.