discourse/db/migrate/20200903045539_add_index_to...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
436 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class AddIndexTopicsOnTimestampsPrivate < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def up
execute <<~SQL
CREATE INDEX CONCURRENTLY IF NOT EXISTS
index_topics_on_timestamps_private
ON topics (bumped_at, created_at, updated_at)
WHERE deleted_at IS NULL AND archetype = 'private_message'
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end