mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
12436d054d
That column is obsolete since we added the `granted_title_badge_id` column in 2019 (56d3e29a69
). Having both columns can lead to inconsistencies (mostly due to old data from before 2019).
For example, `BadgeGranter.revoke_ungranted_titles!` doesn't work correctly if `badge_granted_title` is `false` while `granted_title_badge_id` points to the badge that is used as title.
14 lines
345 B
Ruby
14 lines
345 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DropBadgeGrantedTitleColumn < ActiveRecord::Migration[7.0]
|
|
DROPPED_COLUMNS ||= { user_profiles: %i[badge_granted_title] }
|
|
|
|
def up
|
|
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|