Sha256: aaac66ea104e473b67c6532352d53e8ee187bdbe877c65e17b518d92f0934dbf

Contents?: true

Size: 762 Bytes

Versions: 9

Compression:

Stored size: 762 Bytes

Contents

# This migration comes from spree (originally 20131001013410)
class RemoveUnusedCreditCardFields < ActiveRecord::Migration[4.2]
  def up
    remove_column :spree_credit_cards, :start_month if column_exists?(:spree_credit_cards, :start_month)
    remove_column :spree_credit_cards, :start_year if column_exists?(:spree_credit_cards, :start_year)
    remove_column :spree_credit_cards, :issue_number if column_exists?(:spree_credit_cards, :issue_number)
  end
  def down
    add_column :spree_credit_cards, :start_month,  :string
    add_column :spree_credit_cards, :start_year,   :string
    add_column :spree_credit_cards, :issue_number, :string
  end

  def column_exists?(table, column)
    ApplicationRecord.connection.column_exists?(table, column)
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195811_remove_unused_credit_card_fields.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091752_remove_unused_credit_card_fields.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091752_remove_unused_credit_card_fields.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516181940_remove_unused_credit_card_fields.spree.rb