Skip to content
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 database migration logic #1501

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Fix database migration logic #1501

merged 2 commits into from
Jul 17, 2024

Conversation

hjiangsu
Copy link
Member

Pull Request Description

This PR attempts to fix some of the database migration logic going from 0.4.0 -> 0.5.0. The main changes are listed here:

  • Exported the schema for each of the database version upgrades. This is used to generate migration steps to help ease migration logic. See https://drift.simonbinder.eu/docs/migrations/step_by_step/#generating-step-by-step-code for more details
  • Updated the migration logic to use the step-by-step migrations from before. Note: I was unable to find official documentation on how to perform database downgrades, so that is missing from this PR. If there is an easy way to do this, please let me know!
  • I set a default value for the listIndex in the Accounts table. This is to allow the migration to happen successfully (otherwise it throws an error that the column has a null value when creating the column)

I only tested this migration from 0.4.0 -> develop, and from the current nightly -> develop to check for any database issues.

Issue Being Fixed

Issue Number: #1500 (related)

Screenshots / Recordings

Checklist

  • If a new package was added, did you ensure it uses an appropriate license and is actively maintained?
  • Did you use localized strings (and added appropriate descriptions) where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

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

Looks great, thanks so much for fixing this!

@hjiangsu hjiangsu merged commit 6415787 into develop Jul 17, 2024
1 check passed
@hjiangsu hjiangsu deleted the fix/database-migrations branch July 17, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants