mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 03:48:23 +00:00
9334d2f4f7
Migrates email user options to a new data structure, where `email_always`, `email_direct` and `email_private_messages` are replace by * `email_messages_level`, with options: `always`, `only_when_away` and `never` (defaults to `always`) * `email_level`, with options: `always`, `only_when_away` and `never` (defaults to `only_when_away`)
20 lines
395 B
Ruby
20 lines
395 B
Ruby
require 'migration/column_dropper'
|
|
|
|
class DropEmailUserOptionsColumns < ActiveRecord::Migration[5.2]
|
|
def up
|
|
{
|
|
user_options: %i{
|
|
email_direct
|
|
email_private_messages
|
|
email_always
|
|
},
|
|
}.each do |table, columns|
|
|
Migration::ColumnDropper.execute_drop(table, columns)
|
|
end
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|