Skip to content

Commit 297d3c5

Browse files
committed
Fixed migrations so you can rollback them all
1 parent 330ccfe commit 297d3c5

3 files changed

+94
-2
lines changed

core/db/migrate/20160101010000_solidus_one_four.rb

+92
Original file line numberDiff line numberDiff line change
@@ -972,4 +972,96 @@ def up
972972
t.datetime "updated_at", precision: 6
973973
end
974974
end
975+
976+
def down
977+
drop_table "friendly_id_slugs"
978+
drop_table "spree_addresses"
979+
drop_table "spree_adjustment_reasons"
980+
drop_table "spree_adjustments"
981+
drop_table "spree_assets"
982+
drop_table "spree_calculators"
983+
drop_table "spree_cartons"
984+
drop_table "spree_countries"
985+
drop_table "spree_credit_cards"
986+
drop_table "spree_customer_returns"
987+
drop_table "spree_inventory_units"
988+
drop_table "spree_line_item_actions"
989+
drop_table "spree_line_items"
990+
drop_table "spree_log_entries"
991+
drop_table "spree_option_type_prototypes"
992+
drop_table "spree_option_types"
993+
drop_table "spree_option_values"
994+
drop_table "spree_option_values_variants"
995+
drop_table "spree_order_mutexes"
996+
drop_table "spree_orders"
997+
drop_table "spree_orders_promotions"
998+
drop_table "spree_payment_capture_events"
999+
drop_table "spree_payment_methods"
1000+
drop_table "spree_payments"
1001+
drop_table "spree_preferences"
1002+
drop_table "spree_prices"
1003+
drop_table "spree_product_option_types"
1004+
drop_table "spree_product_promotion_rules"
1005+
drop_table "spree_product_properties"
1006+
drop_table "spree_products"
1007+
drop_table "spree_products_taxons"
1008+
drop_table "spree_promotion_actions"
1009+
drop_table "spree_promotion_categories"
1010+
drop_table "spree_promotion_codes"
1011+
drop_table "spree_promotion_code_batches"
1012+
drop_table "spree_promotion_rule_taxons"
1013+
drop_table "spree_promotion_rules"
1014+
drop_table "spree_promotion_rules_stores"
1015+
drop_table "spree_promotion_rules_users"
1016+
drop_table "spree_promotions"
1017+
drop_table "spree_properties"
1018+
drop_table "spree_property_prototypes"
1019+
drop_table "spree_prototype_taxons"
1020+
drop_table "spree_prototypes"
1021+
drop_table "spree_refund_reasons"
1022+
drop_table "spree_refunds"
1023+
drop_table "spree_reimbursement_credits"
1024+
drop_table "spree_reimbursement_types"
1025+
drop_table "spree_reimbursements"
1026+
drop_table "spree_return_authorizations"
1027+
drop_table "spree_return_items"
1028+
drop_table "spree_return_reasons"
1029+
drop_table "spree_roles"
1030+
drop_table "spree_roles_users"
1031+
drop_table "spree_shipments"
1032+
drop_table "spree_shipping_categories"
1033+
drop_table "spree_shipping_method_categories"
1034+
drop_table "spree_shipping_method_stock_locations"
1035+
drop_table "spree_shipping_method_zones"
1036+
drop_table "spree_shipping_methods"
1037+
drop_table "spree_shipping_rate_taxes"
1038+
drop_table "spree_shipping_rates"
1039+
drop_table "spree_state_changes"
1040+
drop_table "spree_states"
1041+
drop_table "spree_stock_items"
1042+
drop_table "spree_stock_locations"
1043+
drop_table "spree_stock_movements"
1044+
drop_table "spree_store_credit_categories"
1045+
drop_table "spree_store_credit_events"
1046+
drop_table "spree_store_credit_types"
1047+
drop_table "spree_store_credit_update_reasons"
1048+
drop_table "spree_store_credits"
1049+
drop_table "spree_store_payment_methods"
1050+
drop_table "spree_stores"
1051+
drop_table "spree_tax_rates"
1052+
drop_table "spree_tax_categories"
1053+
drop_table "spree_taxonomies"
1054+
drop_table "spree_taxons"
1055+
drop_table "spree_unit_cancels"
1056+
drop_table "spree_user_addresses"
1057+
drop_table "spree_user_stock_locations"
1058+
drop_table "spree_variant_property_rule_conditions"
1059+
drop_table "spree_variant_property_rule_values"
1060+
drop_table "spree_variant_property_rules"
1061+
drop_table "spree_variants"
1062+
drop_table "spree_wallet_payment_sources"
1063+
drop_table "spree_users"
1064+
drop_table "spree_zone_members"
1065+
drop_table "spree_zones"
1066+
end
9751067
end

core/db/migrate/20180416083007_add_apply_to_all_to_variant_property_rule.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class AddApplyToAllToVariantPropertyRule < ActiveRecord::Migration[5.1]
4-
def change
4+
def up
55
add_column :spree_variant_property_rules, :apply_to_all, :boolean, default: false, null: false
66
change_column :spree_variant_property_rules, :apply_to_all, :boolean, default: true
77
end

legacy_promotions/db/migrate/20231027084517_add_order_promotions_foreign_key.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def up
88

99
def down
1010
if foreign_key_exists?(:spree_orders_promotions, :spree_orders, column: :order_id)
11-
remove_foreign_key :spree_orders_promotions, :spree_orders_promotions
11+
remove_foreign_key :spree_orders_promotions, :spree_orders, column: :order_id
1212
end
1313
end
1414
end

0 commit comments

Comments
 (0)