DEV: Add locale for topics (#32619)

Similar to https://github.com/discourse/discourse/pull/32526.

Reviewer note: There had been some deliberation if we should just take
the `topic.first_post.locale` instead of having a `topic.locale`.
Ultimately, titles may be of a different language of the post itself,
and secondarily in some cases it could be faster without having to load
the first_post at all.
This commit is contained in:
Natalie Tay
2025-05-07 22:25:58 +08:00
committed by GitHub
parent 61de461412
commit 6455e75da1
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -2233,6 +2233,7 @@ end
# bannered_until :datetime
# external_id :string
# visibility_reason_id :integer
# locale :string(20)
#
# Indexes
#
@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddLocaleToTopic < ActiveRecord::Migration[7.2]
def change
add_column :topics, :locale, :string, limit: 20
end
end