From b6d10df3320e4f57e0489fd58b554dd2c4704178 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 6 Jul 2023 13:40:07 +1000 Subject: [PATCH] DropSpreePromotionTables --- ...30706033212_drop_spree_promotion_tables.rb | 9 ++++ db/schema.rb | 45 +------------------ 2 files changed, 10 insertions(+), 44 deletions(-) create mode 100644 db/migrate/20230706033212_drop_spree_promotion_tables.rb diff --git a/db/migrate/20230706033212_drop_spree_promotion_tables.rb b/db/migrate/20230706033212_drop_spree_promotion_tables.rb new file mode 100644 index 0000000000..0017b14e93 --- /dev/null +++ b/db/migrate/20230706033212_drop_spree_promotion_tables.rb @@ -0,0 +1,9 @@ +class DropSpreePromotionTables < ActiveRecord::Migration[7.0] + def change + drop_table :spree_products_promotion_rules + drop_table :spree_promotion_action_line_items + drop_table :spree_promotion_actions + drop_table :spree_promotion_rules + drop_table :spree_promotion_rules_users + end +end diff --git a/db/schema.rb b/db/schema.rb index 0288deec3f..533ad446c6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_06_28_144825) do +ActiveRecord::Schema[7.0].define(version: 2023_07_06_033212) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -763,13 +763,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_28_144825) do t.index ["supplier_id"], name: "index_spree_products_on_supplier_id" end - create_table "spree_products_promotion_rules", id: false, force: :cascade do |t| - t.integer "product_id" - t.integer "promotion_rule_id" - t.index ["product_id"], name: "index_products_promotion_rules_on_product_id" - t.index ["promotion_rule_id"], name: "index_products_promotion_rules_on_promotion_rule_id" - end - create_table "spree_products_taxons", id: :serial, force: :cascade do |t| t.integer "product_id" t.integer "taxon_id" @@ -777,36 +770,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_28_144825) do t.index ["taxon_id"], name: "index_products_taxons_on_taxon_id" end - create_table "spree_promotion_action_line_items", id: :serial, force: :cascade do |t| - t.integer "promotion_action_id" - t.integer "variant_id" - t.integer "quantity", default: 1 - end - - create_table "spree_promotion_actions", id: :serial, force: :cascade do |t| - t.integer "activator_id" - t.integer "position" - t.string "type", limit: 255 - end - - create_table "spree_promotion_rules", id: :serial, force: :cascade do |t| - t.integer "activator_id" - t.integer "user_id" - t.integer "product_group_id" - t.string "type", limit: 255 - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.index ["product_group_id"], name: "index_promotion_rules_on_product_group_id" - t.index ["user_id"], name: "index_promotion_rules_on_user_id" - end - - create_table "spree_promotion_rules_users", id: false, force: :cascade do |t| - t.integer "user_id" - t.integer "promotion_rule_id" - t.index ["promotion_rule_id"], name: "index_promotion_rules_users_on_promotion_rule_id" - t.index ["user_id"], name: "index_promotion_rules_users_on_user_id" - end - create_table "spree_properties", id: :serial, force: :cascade do |t| t.string "name", limit: 255 t.string "presentation", limit: 255, null: false @@ -1307,14 +1270,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_28_144825) do add_foreign_key "spree_products", "spree_shipping_categories", column: "shipping_category_id", name: "spree_products_shipping_category_id_fk" add_foreign_key "spree_products", "spree_tax_categories", column: "tax_category_id", name: "spree_products_tax_category_id_fk" add_foreign_key "spree_products", "spree_taxons", column: "primary_taxon_id", name: "spree_products_primary_taxon_id_fk" - add_foreign_key "spree_products_promotion_rules", "spree_products", column: "product_id", name: "spree_products_promotion_rules_product_id_fk" - add_foreign_key "spree_products_promotion_rules", "spree_promotion_rules", column: "promotion_rule_id", name: "spree_products_promotion_rules_promotion_rule_id_fk" add_foreign_key "spree_products_taxons", "spree_products", column: "product_id", name: "spree_products_taxons_product_id_fk", on_delete: :cascade add_foreign_key "spree_products_taxons", "spree_taxons", column: "taxon_id", name: "spree_products_taxons_taxon_id_fk", on_delete: :cascade - add_foreign_key "spree_promotion_action_line_items", "spree_promotion_actions", column: "promotion_action_id", name: "spree_promotion_action_line_items_promotion_action_id_fk" - add_foreign_key "spree_promotion_action_line_items", "spree_variants", column: "variant_id", name: "spree_promotion_action_line_items_variant_id_fk" - add_foreign_key "spree_promotion_actions", "spree_activators", column: "activator_id", name: "spree_promotion_actions_activator_id_fk" - add_foreign_key "spree_promotion_rules", "spree_activators", column: "activator_id", name: "spree_promotion_rules_activator_id_fk" add_foreign_key "spree_return_authorizations", "spree_orders", column: "order_id", name: "spree_return_authorizations_order_id_fk" add_foreign_key "spree_roles_users", "spree_roles", column: "role_id", name: "spree_roles_users_role_id_fk" add_foreign_key "spree_roles_users", "spree_users", column: "user_id", name: "spree_roles_users_user_id_fk"