Sha256: 2abb5843e609c72cddad33ca55ff87ba1d8e9ee46821ac5145a59de67aa5b02e
Contents?: true
Size: 702 Bytes
Versions: 21
Compression:
Stored size: 702 Bytes
Contents
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) ActiveRecord::Base.connection.column_exists?(table, column) end end
Version data entries
21 entries across 21 versions & 1 rubygems