mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Add migration to remove deleted variants from order cycles
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user