Skip to content

Squash migrations - #12830

Merged
SchrodingersGat merged 15 commits into
inventree:masterfrom
SchrodingersGat:squash-migrations
Sep 11, 2026
Merged

SchrodingersGat merged 15 commits into
inventree:masterfrom
SchrodingersGat:squash-migrations

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Tasks

  • Get CI passing
  • Create a 1.0.0 database artifact to migrate from during CI
  • Add documentation around migration procedure across 1.0.0 release boundary

@SchrodingersGat SchrodingersGat added this to the 1.6.0 milestone Sep 9, 2026
@SchrodingersGat SchrodingersGat added setup Relates to the InvenTree setup / installation process breaking Indicates a major update or change which breaks compatibility documentation migration Data or schema migrations full-run Always do a full QC CI run labels Sep 9, 2026
@SchrodingersGat
SchrodingersGat marked this pull request as draft September 9, 2026 05:47
@netlify

netlify Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit ae3ed1e
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6aa37b2b06e5070008af0516

@codecov

codecov Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.43243% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.14%. Comparing base (028d1cb) to head (ae3ed1e).

❌ Your patch check has failed because the patch coverage (73.91%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12830      +/-   ##
==========================================
- Coverage   87.15%   87.14%   -0.02%     
==========================================
  Files        1487     1500      +13     
  Lines      101500   101777     +277     
  Branches    11640    11547      -93     
==========================================
+ Hits        88463    88689     +226     
- Misses      12974    13025      +51     
  Partials       63       63              
Flag Coverage Δ
backend 91.80% <81.08%> (+0.59%) ⬆️
migrations-mysql 34.59% <80.63%> (-3.43%) ⬇️
migrations-postgresql 34.59% <80.63%> (-3.43%) ⬇️
migrations-sqlite 34.60% <80.63%> (-3.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Backend Apps 92.49% <88.77%> (-0.01%) ⬇️
Backend General 94.62% <73.91%> (-0.13%) ⬇️
Frontend 79.62% <ø> (-0.04%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat

Copy link
Copy Markdown
Member Author

@matmair lmk what you think of this approach. Everything after 1.0.0 is left in place

@matmair matmair left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good in general; great to get this addressed;
I might have overlooked it; is there a specific error message / communication that ensures the user is aware of this restriction?

Would be great to get a dedicated Error Code too.

@SchrodingersGat

Copy link
Copy Markdown
Member Author

@matmair a specific error message has now been implemented, and is explicitly checked for in CI

@SchrodingersGat
SchrodingersGat marked this pull request as ready for review September 11, 2026 03:54
@SchrodingersGat

Copy link
Copy Markdown
Member Author
image

Compared to master:

image

@matmair

matmair commented Sep 11, 2026

Copy link
Copy Markdown
Member

Looks great! It is a large change but I think we have the major things that could go wrong covered.
Thank you for taking the time to address this, this is much cleaner then my attempts.

@SchrodingersGat

Copy link
Copy Markdown
Member Author

It's good to finally get this working. We can let it run on master for a while as we prepare for 1.6.0

@SchrodingersGat
SchrodingersGat merged commit c26db6a into inventree:master Sep 11, 2026
52 of 53 checks passed
@SchrodingersGat
SchrodingersGat deleted the squash-migrations branch September 11, 2026 06:56
aniketdev2018 added a commit to EQUA-AI/InvenTree that referenced this pull request Oct 21, 2026
A rehearsal on a copy of the Azure database showed the guard refusing
startup migration over seven applied records it had never seen: build
0021-0026 (20201020-20201023) and part 0061_auto_20210104_2331. Upstream
squash c26db6a (2026-09-11, inventree#12830) dropped them from every on-disk
replaces list. The guard now exempts exactly those seven names, with
their provenance; any other unknown name is still refused.

Tests: assets.tests.test_deploy_lineage 10/10 (offline runner).
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 documentation full-run Always do a full QC CI run migration Data or schema migrations setup Relates to the InvenTree setup / installation process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Squash migrations for better performance

2 participants