Sha256: a7613c3f21885411b97bc84f44d0a4df4f4e9437901b4fa13cb108f35393441f

Contents?: true

Size: 491 Bytes

Versions: 9

Compression:

Stored size: 491 Bytes

Contents

# This migration comes from spree (originally 20130414000512)
class UpdateNameFieldsOnSpreeCreditCards < ActiveRecord::Migration[4.2]
  def up
    if ApplicationRecord.connection.adapter_name.downcase.include? "mysql"
      execute "UPDATE spree_credit_cards SET name = CONCAT(first_name, ' ', last_name)"
    else
      execute "UPDATE spree_credit_cards SET name = first_name || ' ' || last_name"
    end
  end

  def down
    execute "UPDATE spree_credit_cards SET name = NULL"
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195765_update_name_fields_on_spree_credit_cards.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091706_update_name_fields_on_spree_credit_cards.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091706_update_name_fields_on_spree_credit_cards.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516181894_update_name_fields_on_spree_credit_cards.spree.rb