Sha256: b05b0fd4d025c0cee5f8dd91259062b1c55a3dcc488a10e377c52114b5be4286

Contents?: true

Size: 788 Bytes

Versions: 11

Compression:

Stored size: 788 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
solidus_core-1.4.2 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.3.2 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.4.1 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.4.0 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.4.0.rc1 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.4.0.beta1 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.3.1 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.3.0 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.3.0.rc2 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.3.0.rc1 db/migrate/20130304162240_create_spree_shipping_rates.rb
solidus_core-1.3.0.beta1 db/migrate/20130304162240_create_spree_shipping_rates.rb