mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
34b7bee568
* This commit also introduces a `TopicStatusUpdate` model to support other forms of deferred topic status update in the future.
14 lines
326 B
Ruby
14 lines
326 B
Ruby
class AddIndexToTopicStatusUpdates < ActiveRecord::Migration
|
|
def up
|
|
execute <<~SQL
|
|
CREATE UNIQUE INDEX idx_topic_id_status_type_deleted_at
|
|
ON topic_status_updates(topic_id, status_type)
|
|
WHERE deleted_at IS NULL
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
execute "DROP INDEX idx_topic_id_status_type_deleted_at"
|
|
end
|
|
end
|