-
-
Notifications
You must be signed in to change notification settings - Fork 873
fix: various alembic migration issues with queries #2773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: various alembic migration issues with queries #2773
Conversation
could you maybe give my backup a test? |
Sure, do you have a link? |
Whelp, your backup broke several things. They seem fixed now, though to be honest I'm not quite sure why. I built the SQL manually and ran some tests locally to make sure data was still intact. I'm going to send over the migrated db on Discord, if you can check to make sure it works that'd be great. |
alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py
Outdated
Show resolved
Hide resolved
alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py
Outdated
Show resolved
Hide resolved
alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py
Outdated
Show resolved
Hide resolved
alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py
Outdated
Show resolved
Hide resolved
alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py
Outdated
Show resolved
Hide resolved
alembic/versions/2023-10-04-14.29.26_dded3119c1fe_added_unique_constraints.py
Outdated
Show resolved
Hide resolved
alembic/versions/2023-09-01-14.55.42_0341b154f79a_added_normalized_unit_and_food_names.py
Show resolved
Hide resolved
I had two different sqlite formats in my test data - one had UUIDs with dashes, one didn't. I resolved the ambiguity by changing the select statement to just give me the raw DB value, rather than trying to coerce things. Both of my test dbs were successful with this change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will leave it up to you to merge 🚀
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
(REQUIRED)
Building off of #2760, another issue came up where committing the transaction was executing the faulty SELECT statement. This PR should prevent this by disabling auto refreshes after commits for this session.
Which issue(s) this PR fixes:
(REQUIRED)
Mentioned in #2769
Testing
(fill-in or delete this section)
Pulled a backup from an older version with dupes and confirmed it migrates correctly now.