Compare commits

...

3 Commits

Author SHA1 Message Date
Pau Perez
3c8aa875a0 Update db/schema's timestamp after migration 2021-02-09 14:53:52 +01:00
Andy Brett
49c8cb82c7 use #destroy_all 2021-02-09 14:53:49 +01:00
Andy Brett
ef70bfdc3c remove variants with no product 2021-02-09 14:53:44 +01:00
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
class MigrateVariantUnitValues < ActiveRecord::Migration
def up
Spree::Variant.where(product_id: nil).destroy_all
Spree::Variant.where(unit_value: [nil, Float::NAN]).find_each do |variant|
variant.unit_value = 1
variant.save

View File

@@ -11,8 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20210203215049) do
ActiveRecord::Schema.define(version: 20210203214304) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"