Sha256: a7f48febb5bc41ed7a9f14c59dbd4866612a10e3853e296f1b492c9e39020a0e

Contents?: true

Size: 849 Bytes

Versions: 120

Compression:

Stored size: 849 Bytes

Contents

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

120 entries across 120 versions & 1 rubygems

Version Path
spree_core-4.0.9 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.1.15 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.2.7 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.3 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.2.6 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.2 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.0 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.0.rc3 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.0.rc2 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.3.0.rc1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.2.5 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.1.14 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.0.8 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.2.4 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-3.7.14.1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.2.3.1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.1.13.1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.0.7.1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-4.2.3 db/migrate/20130306181701_add_address_fields_to_stock_location.rb