diff --git a/app/models/status_stat.rb b/app/models/status_stat.rb index 7c7e32d434..3e5f564fee 100644 --- a/app/models/status_stat.rb +++ b/app/models/status_stat.rb @@ -13,7 +13,6 @@ # updated_at :datetime not null # emoji_reactions :string # emoji_reactions_count :integer default(0), not null -# test :integer default(0), not null # emoji_reaction_accounts_count :integer default(0), not null # status_referred_by_count :integer default(0), not null # diff --git a/db/migrate/20240117021025_remove_unused_table.rb b/db/migrate/20240117021025_remove_unused_table.rb new file mode 100644 index 0000000000..945c704f70 --- /dev/null +++ b/db/migrate/20240117021025_remove_unused_table.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RemoveUnusedTable < ActiveRecord::Migration[7.1] + disable_ddl_transaction! + + def up + safety_assured do + execute('DROP TABLE IF EXISTS account_groups CASCADE') + execute('ALTER TABLE status_stats DROP COLUMN IF EXISTS test') + end + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index ea82cb028c..1024b85113 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.1].define(version: 2024_01_09_103012) do +ActiveRecord::Schema[7.1].define(version: 2024_01_17_021025) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -50,15 +50,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_09_103012) do t.index ["account_id", "domain"], name: "index_account_domain_blocks_on_account_id_and_domain", unique: true end - create_table "account_groups", force: :cascade do |t| - t.bigint "account_id", null: false - t.bigint "group_account_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["account_id"], name: "index_account_groups_on_account_id" - t.index ["group_account_id"], name: "index_account_groups_on_group_account_id" - end - create_table "account_migrations", force: :cascade do |t| t.bigint "account_id" t.string "acct", default: "", null: false @@ -1200,7 +1191,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_09_103012) do t.datetime "updated_at", precision: nil, null: false t.string "emoji_reactions" t.integer "emoji_reactions_count", default: 0, null: false - t.integer "test", default: 0, null: false t.integer "emoji_reaction_accounts_count", default: 0, null: false t.integer "status_referred_by_count", default: 0, null: false t.index ["status_id"], name: "index_status_stats_on_status_id", unique: true @@ -1427,7 +1417,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_01_09_103012) do add_foreign_key "account_conversations", "conversations", on_delete: :cascade add_foreign_key "account_deletion_requests", "accounts", on_delete: :cascade add_foreign_key "account_domain_blocks", "accounts", name: "fk_206c6029bd", on_delete: :cascade - add_foreign_key "account_groups", "accounts", on_delete: :cascade add_foreign_key "account_migrations", "accounts", column: "target_account_id", on_delete: :nullify add_foreign_key "account_migrations", "accounts", on_delete: :cascade add_foreign_key "account_moderation_notes", "accounts" diff --git a/lib/tasks/dangerous.rake b/lib/tasks/dangerous.rake index bf87264de3..8086e56e5b 100644 --- a/lib/tasks/dangerous.rake +++ b/lib/tasks/dangerous.rake @@ -77,9 +77,10 @@ namespace :dangerous do 20230308061833 20230223102416 20230222232121 + 20240117021025 ) + # Removed: account_groups target_tables = %w( - account_groups antennas antenna_accounts antenna_domains @@ -144,7 +145,7 @@ namespace :dangerous do %w(status_stats emoji_reactions_count), %w(status_stats emoji_reaction_accounts_count), %w(status_stats status_referred_by_count), - %w(status_stats test), + # Removed: status_stats test ] target_indices = %w( index_statuses_on_url