From 1706b8b4bcc49e5d051cf5d55545e754d05db40d Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 8 Aug 2023 14:37:38 +1000 Subject: [PATCH] fixup: Drop spree_products_taxons join table Make it reversible for dev or staging. --- .../20230807145022_remove_product_taxons_table.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/db/migrate/20230807145022_remove_product_taxons_table.rb b/db/migrate/20230807145022_remove_product_taxons_table.rb index 5b7d73a779..ec62363710 100644 --- a/db/migrate/20230807145022_remove_product_taxons_table.rb +++ b/db/migrate/20230807145022_remove_product_taxons_table.rb @@ -1,5 +1,13 @@ class RemoveProductTaxonsTable < ActiveRecord::Migration[7.0] def change - drop_table :spree_products_taxons + remove_foreign_key "spree_products_taxons", "spree_products", column: "product_id", name: "spree_products_taxons_product_id_fk", on_delete: :cascade + remove_foreign_key "spree_products_taxons", "spree_taxons", column: "taxon_id", name: "spree_products_taxons_taxon_id_fk", on_delete: :cascade + + drop_table :spree_products_taxons do |t| + t.integer "product_id" + t.integer "taxon_id" + t.index ["product_id"], name: "index_products_taxons_on_product_id" + t.index ["taxon_id"], name: "index_products_taxons_on_taxon_id" + end end end