0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 02:51:10 +08:00
discourse/db/migrate/20191030112559_add_index_to_notifications.rb
2023-01-09 11:59:41 +00:00

15 lines
358 B
Ruby
Vendored

# frozen_string_literal: true
class AddIndexToNotifications < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def up
if !index_exists?(:notifications, %i[topic_id post_number])
add_index :notifications, %i[topic_id post_number], algorithm: :concurrently
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end