Sha256: f86dc55e6f8a8db46e257bc63627b973f794fa136a347c5961f7fdb68477d29b

Contents?: true

Size: 865 Bytes

Versions: 2

Compression:

Stored size: 865 Bytes

Contents

# This migration comes from spree (originally 20130304162240)
class CreateSpreeShippingRates < ActiveRecord::Migration
  def up
    create_table :spree_shipping_rates do |t|
      t.belongs_to :shipment
      t.belongs_to :shipping_method
      t.boolean :selected, :default => false
      t.decimal :cost, :precision => 8, :scale => 2
      t.timestamps null: true
    end
    add_index(:spree_shipping_rates, [:shipment_id, :shipping_method_id],
              :name => 'spree_shipping_rates_join_index',
              :unique => true)

    # Spree::Shipment.all.each do |shipment|
    #   shipping_method = Spree::ShippingMethod.find(shipment.shipment_method_id)
    #   shipment.add_shipping_method(shipping_method, true)
    # end
  end

  def down
    # add_column :spree_shipments, :shipping_method_id, :integer
    drop_table :spree_shipping_rates
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_order_reporting-0.0.2 spec/dummy/db/migrate/20160707103388_create_spree_shipping_rates.spree.rb
spree_order_reporting-0.0.1 spec/dummy/db/migrate/20160706112340_create_spree_shipping_rates.spree.rb