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

Remove destructive actions from migration 20180710170104 #3109

Conversation

spaghetticode
Copy link
Member

Description

Removing tables and renaming columns are destructive actions as they change the
DB schema in a way that is likely to be not compatible with previous code.

This is especially dangerous when deploying multi-instance applications as
migrations can run before all instances code is synced. When this happens,
these instances may experience severe downtime due to high error rates.

So destructive changes should be done in subsequent deploys: first add the new
table and columns, then later remove the stale ones.

Table spree_store_credit_update_reasons and its column update_reason_id
will need to be removed in a future release of Solidus.

Checklist:

Removing tables and renaming columns are destructive actions as they change the
DB schema in a way that is likely to be not compatible with previous code.

This is especially dangerous when deploying multi-instance applications as
migrations can run before all instances code is synced. When this happens,
these instances may experience severe downtime due to high error rates.

So destructive changes should be done in subsequent deploys: first add the new
table and columns, then later remove the stale ones.

Table `spree_store_credit_update_reasons` and its column `update_reason_id`
will need to be removed in a future release of Solidus.
@spaghetticode spaghetticode force-pushed the spaghetticode/safer-migration-20180710170104 branch from 8aa9001 to da25ae7 Compare February 20, 2019 11:59
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

I really like this approach. Thanks 👍

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @spaghetticode

@kennyadsl kennyadsl merged commit e16106f into solidusio:master Feb 20, 2019
@kennyadsl kennyadsl deleted the spaghetticode/safer-migration-20180710170104 branch February 20, 2019 20:53
@kennyadsl kennyadsl mentioned this pull request Feb 21, 2019
2 tasks
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.

4 participants