Skip to content

Adjust default behavior of "migrate" command#12320

Merged
SchrodingersGat merged 10 commits into
inventree:masterfrom
SchrodingersGat:migrate-change
Jul 9, 2026
Merged

Adjust default behavior of "migrate" command#12320
SchrodingersGat merged 10 commits into
inventree:masterfrom
SchrodingersGat:migrate-change

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Jul 7, 2026

Copy link
Copy Markdown
Member

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

  • Add breaking changelog entry

- Does not create new migration files automatically
@SchrodingersGat SchrodingersGat added the setup Relates to the InvenTree setup / installation process label Jul 7, 2026
@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 9e3f563
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a4f6e15806721000a6cc257
😎 Deploy Preview https://deploy-preview-12320--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 92 (no change from production)
Accessibility: 82 (no change from production)
Best Practices: 92 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@SchrodingersGat SchrodingersGat added the CI CI / unit testing ecosystem label Jul 7, 2026
@SchrodingersGat SchrodingersGat marked this pull request as draft July 7, 2026 02:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from detect=True to detect=False so migration file generation is opt-in.
  • Update CI workflows to explicitly run invoke migrate --detect before 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.

Comment thread tasks.py Outdated
Comment thread tasks.py
@SchrodingersGat

Copy link
Copy Markdown
Member Author

@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

@SchrodingersGat SchrodingersGat marked this pull request as ready for review July 7, 2026 08:49
@SchrodingersGat SchrodingersGat added this to the 1.5.0 milestone Jul 7, 2026
@SchrodingersGat SchrodingersGat added the breaking Indicates a major update or change which breaks compatibility label Jul 7, 2026
@SchrodingersGat SchrodingersGat merged commit 996dbc5 into inventree:master Jul 9, 2026
33 checks passed
@SchrodingersGat SchrodingersGat deleted the migrate-change branch July 9, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Indicates a major update or change which breaks compatibility CI CI / unit testing ecosystem setup Relates to the InvenTree setup / installation process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants