Sha256: 6eea851e1781f5ca5bb4291e03c4a80c81eac7174290888cb77c310f4d156d3c

Contents?: true

Size: 401 Bytes

Versions: 14

Compression:

Stored size: 401 Bytes

Contents

# This migration comes from spree (originally 20140205181631)
class DefaultVariantWeightToZero < ActiveRecord::Migration
  def up
    Spree::Variant.unscoped.where(weight: nil).update_all("weight = 0.0")

    change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2, default: 0.0
  end

  def down
    change_column :spree_variants, :weight, :decimal, precision: 8, scale: 2
  end
end

Version data entries

14 entries across 14 versions & 7 rubygems

Version Path
spree_weight_calculator-0.1.0 test/dummy/db/migrate/20160723192555_default_variant_weight_to_zero.spree.rb
spree_order_reporting-0.0.3 spec/dummy/db/migrate/20160708163152_default_variant_weight_to_zero.spree.rb
spree_order_reporting-0.0.2 spec/dummy/db/migrate/20160707103476_default_variant_weight_to_zero.spree.rb
spree_order_reporting-0.0.1 spec/dummy/db/migrate/20160706112428_default_variant_weight_to_zero.spree.rb
sprangular-0.1.0 spec/dummy/db/migrate/20140814105754_default_variant_weight_to_zero.spree.rb
sprangular-0.0.1 spec/dummy/db/migrate/20140814105754_default_variant_weight_to_zero.spree.rb
spree_mercado_pago-0.2.3 spec/dummy/db/migrate/20141204014747_default_variant_weight_to_zero.spree.rb
spree_mercado_pago-0.2.2 spec/dummy/db/migrate/20141204014747_default_variant_weight_to_zero.spree.rb
spree_mercado_pago-0.2.1 spec/dummy/db/migrate/20141112193530_default_variant_weight_to_zero.spree.rb
spree_mercado_pago-0.2.0 spec/dummy/db/migrate/20141112193530_default_variant_weight_to_zero.spree.rb
spree_mercado_pago_payment_method-0.2.0 spec/dummy/db/migrate/20141112193530_default_variant_weight_to_zero.spree.rb
spree_bitpay-1.0.2 spec/dummy/db/migrate/20141002181326_default_variant_weight_to_zero.spree.rb
bcms_spree-0.0.2 test/dummy/db/migrate/20140915222665_default_variant_weight_to_zero.spree.rb
bcms_spree-0.0.1 test/dummy/db/migrate/20140915222665_default_variant_weight_to_zero.spree.rb