From 5fef6f1011cbcd6345d39246bd09bf3eb1c940c8 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 1 Nov 2024 19:12:34 +0100 Subject: [PATCH] Remove references to acts_as_taggable_on gem --- app/models/guest.rb | 1 - .../20241101181052_drop_taggable_tables.rb | 27 ++++++++++++++++++ db/schema.rb | 28 +------------------ db/seeds.rb | 2 -- 4 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 db/migrate/20241101181052_drop_taggable_tables.rb diff --git a/app/models/guest.rb b/app/models/guest.rb index 412f01c..39d27b3 100644 --- a/app/models/guest.rb +++ b/app/models/guest.rb @@ -1,7 +1,6 @@ # Copyright (C) 2024 Manuel Bustillo class Guest < ApplicationRecord - acts_as_taggable_on :affinity_groups, :unbreakable_bonds belongs_to :group enum status: { diff --git a/db/migrate/20241101181052_drop_taggable_tables.rb b/db/migrate/20241101181052_drop_taggable_tables.rb new file mode 100644 index 0000000..73191e8 --- /dev/null +++ b/db/migrate/20241101181052_drop_taggable_tables.rb @@ -0,0 +1,27 @@ +class DropTaggableTables < ActiveRecord::Migration[7.2] + def change + drop_table 'taggings', force: :cascade do |t| + t.bigint 'tag_id' + t.string 'taggable_type' + t.uuid 'taggable_id' + t.string 'tagger_type' + t.bigint 'tagger_id' + t.string 'context', limit: 128 + t.datetime 'created_at', precision: nil + t.string 'tenant', limit: 128 + t.index ['context'], name: 'index_taggings_on_context' + t.index %w[tag_id taggable_id taggable_type context tagger_id tagger_type], name: 'taggings_idx', + unique: true + t.index ['tag_id'], name: 'index_taggings_on_tag_id' + t.index %w[taggable_id taggable_type context], name: 'taggings_taggable_context_idx' + t.index %w[taggable_id taggable_type tagger_id context], name: 'taggings_idy' + t.index ['taggable_id'], name: 'index_taggings_on_taggable_id' + t.index %w[taggable_type taggable_id], name: 'index_taggings_on_taggable_type_and_taggable_id' + t.index ['taggable_type'], name: 'index_taggings_on_taggable_type' + t.index %w[tagger_id tagger_type], name: 'index_taggings_on_tagger_id_and_tagger_type' + t.index ['tagger_id'], name: 'index_taggings_on_tagger_id' + t.index %w[tagger_type tagger_id], name: 'index_taggings_on_tagger_type_and_tagger_id' + t.index ['tenant'], name: 'index_taggings_on_tenant' + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1c81149..c6de811 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,5 +1,3 @@ -# Copyright (C) 2024 Manuel Bustillo - # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. @@ -12,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2024_08_11_170021) do +ActiveRecord::Schema[7.2].define(version: 2024_11_01_181052) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -67,29 +65,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_11_170021) do t.datetime "updated_at", null: false end - create_table "taggings", force: :cascade do |t| - t.bigint "tag_id" - t.string "taggable_type" - t.uuid "taggable_id" - t.string "tagger_type" - t.bigint "tagger_id" - t.string "context", limit: 128 - t.datetime "created_at", precision: nil - t.string "tenant", limit: 128 - t.index ["context"], name: "index_taggings_on_context" - t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true - t.index ["tag_id"], name: "index_taggings_on_tag_id" - t.index ["taggable_id", "taggable_type", "context"], name: "taggings_taggable_context_idx" - t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy" - t.index ["taggable_id"], name: "index_taggings_on_taggable_id" - t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id" - t.index ["taggable_type"], name: "index_taggings_on_taggable_type" - t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type" - t.index ["tagger_id"], name: "index_taggings_on_tagger_id" - t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id" - t.index ["tenant"], name: "index_taggings_on_tenant" - end - create_table "tags", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false @@ -102,5 +77,4 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_11_170021) do add_foreign_key "guests", "groups" add_foreign_key "seats", "guests" add_foreign_key "seats", "tables_arrangements", on_delete: :cascade - add_foreign_key "taggings", "tags" end diff --git a/db/seeds.rb b/db/seeds.rb index 09d33f7..71b2a31 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,8 +5,6 @@ NUMBER_OF_GUESTS = 50 TablesArrangement.delete_all Expense.delete_all Guest.delete_all -ActsAsTaggableOn::Tagging.delete_all -ActsAsTaggableOn::Tag.delete_all Group.delete_all Expense.create!(name: 'Photographer', amount: 3000, pricing_type: 'fixed')