Sha256: 0a7a27dccd40b7caea0961321d2c5ba4b82a81c2c27c177c2f9b3456fa14160e

Contents?: true

Size: 604 Bytes

Versions: 21

Compression:

Stored size: 604 Bytes

Contents

class CreateShippingMethodZone < ActiveRecord::Migration[4.2]
  class ShippingMethodZone < Spree::Base
    self.table_name = 'shipping_methods_zones'
  end
  def up
    create_table :shipping_methods_zones, id: false do |t|
      t.integer :shipping_method_id
      t.integer :zone_id
    end
    Spree::ShippingMethod.all.each do |sm|
      ShippingMethodZone.create!(zone_id: sm.zone_id, shipping_method_id: sm.id)
    end

    remove_column :spree_shipping_methods, :zone_id
  end

  def down
    drop_table :shipping_methods_zones
    add_column :spree_shipping_methods, :zone_id, :integer
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
solidus_core-2.3.1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.2.2 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.1.1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.0.3 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.3.0 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.3.0.rc3 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.3.0.rc2 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.3.0.rc1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.3.0.beta1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.0.2 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.2.1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.2.0 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.2.0.rc1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.2.0.beta1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.1.0 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.1.0.rc1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.0.1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.1.0.beta1 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.0.0 db/migrate/20130228210442_create_shipping_method_zone.rb
solidus_core-2.0.0.rc1 db/migrate/20130228210442_create_shipping_method_zone.rb