mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 05:31:36 +08:00
Replace individual per-locale queries with a single query that calculates completion progress for all locales at once. This commit also removes methods off the `base_candidate` (used for Categories and Topics as well) which are not used any more, as the progress dashboard only shows progress for posts. t/162846/4 --------- Co-authored-by: Nat <natalie.tay@discourse.org>
13 lines
362 B
Ruby
13 lines
362 B
Ruby
# frozen_string_literal: true
|
|
class AddIndexToPostsLocale < ActiveRecord::Migration[8.0]
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
remove_index :posts, :locale, algorithm: :concurrently, if_exists: true
|
|
add_index :posts, :locale, algorithm: :concurrently
|
|
end
|
|
|
|
def down
|
|
remove_index :posts, :locale, algorithm: :concurrently, if_exists: true
|
|
end
|
|
end
|