Add migration to remove deleted variants from order cycles

This commit is contained in:
Rohan Mitchell
2014-06-12 12:15:37 +10:00
parent 0061caa8df
commit b23430375c
2 changed files with 12 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
class RemoveDeletedVariantsFromOrderCycles < ActiveRecord::Migration
def up
evs = ExchangeVariant.joins(:variant).where('spree_variants.deleted_at IS NOT NULL')
say "Removing #{evs.count} deleted variants from order cycles..."
evs.destroy_all
end
def down
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140604051248) do
ActiveRecord::Schema.define(:version => 20140612020206) do
create_table "adjustment_metadata", :force => true do |t|
t.integer "adjustment_id"
@@ -547,9 +547,9 @@ ActiveRecord::Schema.define(:version => 20140604051248) do
t.string "email"
t.text "special_instructions"
t.integer "distributor_id"
t.integer "order_cycle_id"
t.string "currency"
t.string "last_ip_address"
t.integer "order_cycle_id"
t.integer "cart_id"
end