Sha256: 620327bd222bc2875117d7795ee6aa491ee8cd184159ba9bc1ddecad3e6d60e1

Contents?: true

Size: 870 Bytes

Versions: 3

Compression:

Stored size: 870 Bytes

Contents

# This migration comes from spree (originally 20130304162240)
class CreateSpreeShippingRates < ActiveRecord::Migration[4.2]
  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: false, precision: 6
    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

3 entries across 3 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195745_create_spree_shipping_rates.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091686_create_spree_shipping_rates.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091686_create_spree_shipping_rates.spree.rb