Sha256: b254b17bf6425b5707912378fce7497f1cd5def84d244ba2c31da9bbd38a55a2

Contents?: true

Size: 481 Bytes

Versions: 14

Compression:

Stored size: 481 Bytes

Contents

class AddOrderStore < ActiveRecord::Migration
  def self.up
    if table_exists?('orders')
      add_column :orders, :store_id, :integer
    elsif table_exists?('spree_orders')
      add_column :spree_orders, :store_id, :integer unless column_exists?(:spree_orders, :store_id)
    end
  end

  def self.down
    if table_exists?('orders')
      remove_column :orders, :store_id
    elsif table_exists?('spree_orders')
      remove_column :spree_orders, :store_id
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
solidus_multi_domain-1.5.0 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.4.3 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.4.2 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.4.1 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.4.0 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.3.0 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.2.0 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.1.3 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.1.2 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.1.1 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.0.3 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.1.0 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.0.1 db/migrate/20091202123245_add_order_store.rb
solidus_multi_domain-1.0.0 db/migrate/20091202123245_add_order_store.rb