mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:20:57 -06:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
16 lines
362 B
Ruby
16 lines
362 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddIndexToTopicStatusUpdates < ActiveRecord::Migration[4.2]
|
|
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
|