-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add migration to drop table/column from 20180710170104
#3114
Add migration to drop table/column from 20180710170104
#3114
Conversation
core/db/migrate/20190220093635_drop_spree_store_credit_update_reasons.rb
Outdated
Show resolved
Hide resolved
core/db/migrate/20190220093635_drop_spree_store_credit_update_reasons.rb
Outdated
Show resolved
Hide resolved
Migration `20180710170104` has been reworked with PR#3109 in order to avoid risky situations for multi-instance Solidus installations. The table `spree_store_credit_update_reasons` and the column `update_reason_id` from table `spree_store_credit_events` can be either still be around (this happens when migration `20180710170104` was run after the mod) or not, so we need to check the presence of both in advance. Also, since on rollback the older version of `20180710170104` would create this table then it cannot be created here in a `down` method. When using the updated version of migration `20180710170104`, the table creation will happen in that migration.
2011a3c
to
e08226e
Compare
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.
👏
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.
👍 Table and column being dropped are not used anymore so it's safe to remove them.
If 20180710170104
migration has been added to a store with v2.8.0
or v2.8.1
, they should already not exist. If that migration has been added with v.2.8.2
they will be dropped.
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.
👍 Thanks @spaghetticode!
Migration
20180710170104
has been reworked with PR #3109 in order to avoidrisky situations for multi-instance Solidus installations.
The table
spree_store_credit_update_reasons
and the columnupdate_reason_id
from table
spree_store_credit_events
can be either still be around (thishappens when migration
20180710170104
was run after the mod) or not, so weneed to check the presence of both in advance.
Also, since on rollback the older version of
20180710170104
would create thistable then it cannot be created here in a
down
method.When using the updated version of migration
20180710170104
, the table creationwill happen in that migration.