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

Add migration to drop table/column from 20180710170104 #3114

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

class DropSpreeStoreCreditUpdateReasons < ActiveRecord::Migration[5.1]
# This migration should run in a subsequent deploy after 20180710170104
# has been already deployed. See also migration 20180710170104.

# We can't add back the table in a `down` method here: a previous version
# of migration 20180710170104 would fail with `table already exists` , as
# it handles itself the add/remove of this table and column.
def up
if table_exists? :spree_store_credit_update_reasons
drop_table :spree_store_credit_update_reasons
end

if column_exists? :spree_store_credit_events, :update_reason_id
remove_column :spree_store_credit_events, :update_reason_id
end
end
end