mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
8016fcab33
The `id` column of `notifications` table and `notification_id` columns of the other tables have been migrated to bigint in previous commits (for example, 799a45a). In order to run the migrations with zero downtime, the data had to be copied to new columns and swapped, but the old columns have been kept to allow for rollback. They are no longer needed now.
19 lines
473 B
Ruby
19 lines
473 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DropOldNotificationIdColumns < ActiveRecord::Migration[7.1]
|
|
DROPPED_COLUMNS = {
|
|
notifications: %i[old_id],
|
|
shelved_notifications: %i[old_notification_id],
|
|
users: %i[old_seen_notification_id],
|
|
user_badges: %i[old_notification_id],
|
|
}
|
|
|
|
def up
|
|
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|