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 V4 + V5 SQLite migrations #275

Merged
merged 7 commits into from Mar 10, 2020
Merged

Fix V4 + V5 SQLite migrations #275

merged 7 commits into from Mar 10, 2020

Conversation

thebaer
Copy link
Member

@thebaer thebaer commented Mar 3, 2020

This fixes the unreleased V4 and V5 database migrations so they work with instances backed by SQLite databases.

This previously used a default timestamp value which caused the
migration to fail for SQLite databases.
It's not straightforward to remove these constraints in SQLite, so this
just skips it entirely. Since both of these migrations are part of the
same WF release, this should have minimal impact on admins.
Combining all operations into a single query was causing problems in
SQLite. This fixes that by breaking them up into separate queries. It
also moves one column length change to only run on MySQL, since SQLite
doesn't need it.
Previously, this migration would cause the error: "Cannot add a NOT NULL
column with default value NULL". This fixes that by setting the default
value for new columns to '' (empty string). It updates the query builder
to support this, too.
This index needed a unique name in order for this query to succeed.
We'd like these queries to fail correctly if the tables exist.
@thebaer thebaer added this to the 0.12 milestone Mar 3, 2020
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

confirmed working fix for V{4,5,6} migration using sqlite

@thebaer thebaer requested a review from ngerakines March 9, 2020 21:39
@thebaer
Copy link
Member Author

thebaer commented Mar 10, 2020

Thanks for reviewing!

@thebaer thebaer merged commit bad970c into develop Mar 10, 2020
@thebaer thebaer deleted the fix-v4-migrations branch March 10, 2020 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants