Sha256: 6c46ab5cb00f224f740c6d97c6211a1153007e53d31c9780fed29a6f2c8125fb
Contents?: true
Size: 664 Bytes
Versions: 2
Compression:
Stored size: 664 Bytes
Contents
# This migration comes from spree (originally 20130228210442) class CreateShippingMethodZone < ActiveRecord::Migration 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
2 entries across 2 versions & 1 rubygems