mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 07:43:41 +08:00
16 lines
360 B
Ruby
16 lines
360 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class AddIndexToNotifications < ActiveRecord::Migration[6.0]
|
||
|
disable_ddl_transaction!
|
||
|
|
||
|
def up
|
||
|
if !index_exists?(:notifications, [:topic_id, :post_number])
|
||
|
add_index :notifications, [:topic_id, :post_number], algorithm: :concurrently
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
raise ActiveRecord::IrreversibleMigration
|
||
|
end
|
||
|
end
|