Remove unused index_notifications_on_json_data (#11725)

Co-authored-by: rhymes <rhymes@hey.com>
This commit is contained in:
Michael Kohl 2020-12-05 03:31:16 +07:00 committed by GitHub
parent f7a9f0d2b4
commit de119f59c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -0,0 +1,15 @@
class RemoveIndexNotificationsOnJsonDataFromNotifications < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def up
return unless index_exists?(:notifications, :json_data)
remove_index :notifications, column: :json_data, algorithm: :concurrently
end
def down
return if index_exists?(:notifications, :json_data)
add_index :notifications, :json_data, algorithm: :concurrently, using: :gin
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_11_19_153512) do
ActiveRecord::Schema.define(version: 2020_12_03_063435) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
@ -715,7 +715,6 @@ ActiveRecord::Schema.define(version: 2020_11_19_153512) do
t.datetime "updated_at", null: false
t.bigint "user_id"
t.index ["created_at"], name: "index_notifications_on_created_at"
t.index ["json_data"], name: "index_notifications_on_json_data", using: :gin
t.index ["notifiable_id", "notifiable_type", "action"], name: "index_notifications_on_notifiable_id_notifiable_type_and_action"
t.index ["notifiable_type"], name: "index_notifications_on_notifiable_type"
t.index ["notified_at"], name: "index_notifications_on_notified_at"