From 07667f91e5781d582e857d3d9d49c4f391f110b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KMY=EF=BC=88=E9=9B=AA=E3=81=82=E3=81=99=E3=81=8B=EF=BC=89?= Date: Thu, 28 Mar 2024 12:11:24 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20#287=20DB=E3=82=A4=E3=83=B3=E3=83=87?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=B9=E3=81=AE=E9=87=8D=E8=A4=87=E3=81=AE?= =?UTF-8?q?=E8=A7=A3=E6=B1=BA=20(#680)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...licate_indices_for_kmyblue_original_functions.rb | 13 +++++++++++++ db/schema.rb | 9 +-------- lib/tasks/dangerous.rake | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 db/post_migrate/20240327234026_fix_duplicate_indices_for_kmyblue_original_functions.rb diff --git a/db/post_migrate/20240327234026_fix_duplicate_indices_for_kmyblue_original_functions.rb b/db/post_migrate/20240327234026_fix_duplicate_indices_for_kmyblue_original_functions.rb new file mode 100644 index 0000000000..f35b916781 --- /dev/null +++ b/db/post_migrate/20240327234026_fix_duplicate_indices_for_kmyblue_original_functions.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class FixDuplicateIndicesForKmyblueOriginalFunctions < ActiveRecord::Migration[7.1] + def change + remove_index :antenna_accounts, :antenna_id + remove_index :antenna_domains, :antenna_id + remove_index :antenna_tags, :antenna_id + remove_index :bookmark_category_statuses, :bookmark_category_id + remove_index :circle_accounts, :circle_id + remove_index :circle_statuses, :circle_id + remove_index :list_statuses, :list_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 6c25607468..deaca692cd 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_03_26_231854) do +ActiveRecord::Schema[7.1].define(version: 2024_03_27_234026) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -276,7 +276,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "updated_at", precision: nil, null: false t.index ["account_id"], name: "index_antenna_accounts_on_account_id" t.index ["antenna_id", "account_id"], name: "index_antenna_accounts_on_antenna_id_and_account_id", unique: true - t.index ["antenna_id"], name: "index_antenna_accounts_on_antenna_id" t.index ["exclude"], name: "index_antenna_accounts_on_exclude" end @@ -287,7 +286,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false t.index ["antenna_id", "name"], name: "index_antenna_domains_on_antenna_id_and_name", unique: true - t.index ["antenna_id"], name: "index_antenna_domains_on_antenna_id" t.index ["exclude"], name: "index_antenna_domains_on_exclude" t.index ["name"], name: "index_antenna_domains_on_name" end @@ -299,7 +297,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false t.index ["antenna_id", "tag_id"], name: "index_antenna_tags_on_antenna_id_and_tag_id", unique: true - t.index ["antenna_id"], name: "index_antenna_tags_on_antenna_id" t.index ["exclude"], name: "index_antenna_tags_on_exclude" t.index ["tag_id"], name: "index_antenna_tags_on_tag_id" end @@ -390,7 +387,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["bookmark_category_id", "status_id"], name: "index_bc_statuses", unique: true - t.index ["bookmark_category_id"], name: "index_bookmark_category_statuses_on_bookmark_category_id" t.index ["bookmark_id"], name: "index_bookmark_category_statuses_on_bookmark_id" t.index ["status_id"], name: "index_bookmark_category_statuses_on_status_id" end @@ -446,7 +442,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "updated_at", null: false t.index ["account_id"], name: "index_circle_accounts_on_account_id" t.index ["circle_id", "account_id"], name: "index_circle_accounts_on_circle_id_and_account_id", unique: true - t.index ["circle_id"], name: "index_circle_accounts_on_circle_id" t.index ["follow_id"], name: "index_circle_accounts_on_follow_id" end @@ -456,7 +451,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["circle_id", "status_id"], name: "index_circle_statuses_on_circle_id_and_status_id", unique: true - t.index ["circle_id"], name: "index_circle_statuses_on_circle_id" t.index ["status_id"], name: "index_circle_statuses_on_status_id" end @@ -792,7 +786,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_03_26_231854) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["list_id", "status_id"], name: "index_list_statuses_on_list_id_and_status_id", unique: true - t.index ["list_id"], name: "index_list_statuses_on_list_id" t.index ["status_id"], name: "index_list_statuses_on_status_id" end diff --git a/lib/tasks/dangerous.rake b/lib/tasks/dangerous.rake index 9444559492..0b3a476537 100644 --- a/lib/tasks/dangerous.rake +++ b/lib/tasks/dangerous.rake @@ -96,6 +96,7 @@ namespace :dangerous do 20240312230204 20240320231633 20240326231854 + 20240327234026 ) # Removed: account_groups target_tables = %w(