discourse/db/migrate/20250507110205_add_locale_to_topic.rb
Natalie Tay 6455e75da1
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.
2025-05-07 22:25:58 +08:00

7 lines
160 B
Ruby

# frozen_string_literal: true
class AddLocaleToTopic < ActiveRecord::Migration[7.2]
def change
add_column :topics, :locale, :string, limit: 20
end
end