Sha256: 78aa55c883825a34dc9eda00c1cd35d0d34d9617b82d167c585aa2c6ab056794

Contents?: true

Size: 911 Bytes

Versions: 9

Compression:

Stored size: 911 Bytes

Contents

# This migration comes from spree (originally 20130306181701)
class AddAddressFieldsToStockLocation < ActiveRecord::Migration[4.2]
  def change
    remove_column :spree_stock_locations, :address_id

    add_column :spree_stock_locations, :address1, :string
    add_column :spree_stock_locations, :address2, :string
    add_column :spree_stock_locations, :city, :string
    add_column :spree_stock_locations, :state_id, :integer
    add_column :spree_stock_locations, :state_name, :string
    add_column :spree_stock_locations, :country_id, :integer
    add_column :spree_stock_locations, :zipcode, :string
    add_column :spree_stock_locations, :phone, :string


    usa = Spree::Country.where(iso: 'US').first
    # In case USA isn't found.
    # See #3115
    country = usa || Spree::Country.first
    Spree::Country.reset_column_information
    Spree::StockLocation.update_all(country_id: country)
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195748_add_address_fields_to_stock_location.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091689_add_address_fields_to_stock_location.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091689_add_address_fields_to_stock_location.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516181877_add_address_fields_to_stock_location.spree.rb