Skip to content

Commit

Permalink
Merge pull request #3114 from nebulab/drop-table-from-20180710170104
Browse files Browse the repository at this point in the history
Add migration to drop table/column from `20180710170104`
  • Loading branch information
kennyadsl authored Mar 6, 2019
2 parents bd06b98 + e08226e commit ebba3e0
Showing 1 changed file with 19 additions and 0 deletions.
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

0 comments on commit ebba3e0

Please sign in to comment.