discourse/db/migrate/20240826121503_copy_shelved_notifications_notification_id_indexes.rb
Bianca Nenciu ec8ba5a0b9
DEV: Migrate shelved_notifications#notification_id to bigint (#28549)
DEV: Migrate shelved_notifications#notification_id to bigint

The `notifications.id` has been migrated to `bigint` in previous commit
799a45a291e9f2bd94278f565e58874458768079.
2024-08-27 10:56:00 +08:00

15 lines
518 B
Ruby

# frozen_string_literal: true
class CopyShelvedNotificationsNotificationIdIndexes < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def up
execute "DROP INDEX #{Rails.env.test? ? "" : "CONCURRENTLY"} IF EXISTS index_shelved_notifications_on_new_notification_id"
execute "CREATE INDEX #{Rails.env.test? ? "" : "CONCURRENTLY"} index_shelved_notifications_on_new_notification_id ON shelved_notifications (new_notification_id)"
end
def down
raise ActiveRecord::IrreversibleMigration
end
end