From 8c7f3c53324a7808650c7d82f030f290e692c1e3 Mon Sep 17 00:00:00 2001
From: Claire <claire.github-309c@sitedethib.com>
Date: Mon, 14 Aug 2023 09:38:08 +0200
Subject: [PATCH] Remove old non-unique index on preview_cards statuses join
 table (#26447)

---
 ...ew_cards_statuses_on_status_id_and_preview_card_id.rb | 9 +++++++++
 db/schema.rb                                             | 3 +--
 2 files changed, 10 insertions(+), 2 deletions(-)
 create mode 100644 db/post_migrate/20230811103651_remove_index_preview_cards_statuses_on_status_id_and_preview_card_id.rb

diff --git a/db/post_migrate/20230811103651_remove_index_preview_cards_statuses_on_status_id_and_preview_card_id.rb b/db/post_migrate/20230811103651_remove_index_preview_cards_statuses_on_status_id_and_preview_card_id.rb
new file mode 100644
index 000000000..11e0bf6f1
--- /dev/null
+++ b/db/post_migrate/20230811103651_remove_index_preview_cards_statuses_on_status_id_and_preview_card_id.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class RemoveIndexPreviewCardsStatusesOnStatusIdAndPreviewCardId < ActiveRecord::Migration[7.0]
+  disable_ddl_transaction!
+
+  def change
+    remove_index :preview_cards_statuses, column: [:status_id, :preview_card_id], name: :index_preview_cards_statuses_on_status_id_and_preview_card_id
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 79bebb5ed..fc997f634 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_08_03_112520) do
+ActiveRecord::Schema[7.0].define(version: 2023_08_11_103651) do
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
 
@@ -809,7 +809,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_03_112520) do
   create_table "preview_cards_statuses", primary_key: ["status_id", "preview_card_id"], force: :cascade do |t|
     t.bigint "preview_card_id", null: false
     t.bigint "status_id", null: false
-    t.index ["status_id", "preview_card_id"], name: "index_preview_cards_statuses_on_status_id_and_preview_card_id"
   end
 
   create_table "relays", force: :cascade do |t|