Sha256: 27ebcbe14b5752242a99e56064a98cdbf1aedb10844003d4ef317f9a1613c26e

Contents?: true

Size: 757 Bytes

Versions: 5

Compression:

Stored size: 757 Bytes

Contents

class AddAddressFieldsToStockLocation < ActiveRecord::Migration
  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
    Spree::Country.reset_column_information
    Spree::StockLocation.update_all(:country_id => usa)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_core-2.0.3 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-2.0.2 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-2.0.1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-2.0.0 db/migrate/20130306181701_add_address_fields_to_stock_location.rb
spree_core-2.0.0.rc1 db/migrate/20130306181701_add_address_fields_to_stock_location.rb