mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 19:44:59 +08:00
11 lines
375 B
Ruby
11 lines
375 B
Ruby
# frozen_string_literal: true
|
|
class AddBannerIndexToTopics < ActiveRecord::Migration[6.0]
|
|
def change
|
|
# this speeds up the process for finding banners on the site
|
|
add_index :topics,
|
|
[:id],
|
|
name: "index_topics_on_id_filtered_banner",
|
|
where: "archetype = 'banner' AND deleted_at IS NULL",
|
|
unique: true
|
|
end
|
|
end
|