Adjust default behavior of "migrate" command#12320
Conversation
- Does not create new migration files automatically
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR changes the default behavior of the invoke migrate task so it no longer auto-generates new Django migration files during routine operations (notably invoke update), reducing the risk of creating out-of-line/conflicting migrations during upgrades (ref #12311).
Changes:
- Change
migrate()default fromdetect=Truetodetect=Falseso migration file generation is opt-in. - Update CI workflows to explicitly run
invoke migrate --detectbefore checking for uncommitted migration files.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tasks.py |
Makes migration auto-detection opt-in and expands the task docstring/arguments. |
.github/workflows/qc_checks.yaml |
Runs invoke migrate --detect prior to migration-file checks in QC workflow. |
.github/workflows/check_translations.yaml |
Runs invoke migrate --detect prior to migration-file checks in translations workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@matmair LMK what you think of this - it changes the default behavior but in general, users should NOT be in a situation where they are generating new migration files |

The existing default behavior on "invoke update" is to create new migration files if the database schema has changed. This may lead to the situation outlined in #12311 where we end up with out-of-line migrations.
Tasks