Skip to content

Fix for faulty data migrations - #4987

Merged
SchrodingersGat merged 3 commits into
inventree:masterfrom
SchrodingersGat:new-migration-fix
Jun 8, 2023
Merged

SchrodingersGat merged 3 commits into
inventree:masterfrom
SchrodingersGat:new-migration-fix

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Jun 7, 2023 •

Copy link
Copy Markdown
Member

Replaces #4979

References:

Implements a new fix which does not require any custom SQL, and adds a unit test.

Additionally this migration has been tested multiple times backwards / forwards / upside down

- Add custom migration class which handles errors
- Ensure that the new fields are added to the model
@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed setup Relates to the InvenTree setup / installation process labels Jun 7, 2023
@SchrodingersGat SchrodingersGat added this to the 0.12.0 milestone Jun 7, 2023
@miggland

miggland commented Jun 7, 2023

Copy link
Copy Markdown
Contributor

This looks the "proper" way to do it. 👍

I have tested this, starting at two different points (one of which caused problems with the other implementation), and from scratch, all worked.

@matmair

matmair commented Jun 7, 2023

Copy link
Copy Markdown
Member

It works on ubuntu + mariadb; I only have access to my production/staging environment with SE Linux in a few hours but it should be good.

@SchrodingersGat

Copy link
Copy Markdown
Member Author

@matmair any further input on this or happy for me to merge?

@matmair

matmair commented Jun 8, 2023

Copy link
Copy Markdown
Member

I have tested this in multiple instances now - should fix the issue finally

@matmair matmair mentioned this pull request Jun 8, 2023
@SchrodingersGat
SchrodingersGat merged commit 842d7a9 into inventree:master Jun 8, 2023
@SchrodingersGat
SchrodingersGat deleted the new-migration-fix branch June 8, 2023 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Identifies a bug which needs to be addressed 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.

3 participants