diff options
Diffstat (limited to 'db/migrate/20160610201627_migrate_users_notification_level.rb')
-rw-r--r-- | db/migrate/20160610201627_migrate_users_notification_level.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20160610201627_migrate_users_notification_level.rb b/db/migrate/20160610201627_migrate_users_notification_level.rb index 9da67b59dd1..ce4f00e25fa 100644 --- a/db/migrate/20160610201627_migrate_users_notification_level.rb +++ b/db/migrate/20160610201627_migrate_users_notification_level.rb @@ -5,7 +5,7 @@ class MigrateUsersNotificationLevel < ActiveRecord::Migration DOWNTIME = false def up - execute(%{ + execute(%Q{ INSERT INTO notification_settings (user_id, level, created_at, updated_at) (SELECT id, notification_level, created_at, updated_at FROM users WHERE notification_level != 1) @@ -15,7 +15,7 @@ class MigrateUsersNotificationLevel < ActiveRecord::Migration # Migrates from notification settings back to user notification_level # If no value is found the default level of 1 will be used def down - execute(%{ + execute(%Q{ UPDATE users u SET notification_level = COALESCE((SELECT level FROM notification_settings WHERE user_id = u.id AND source_type IS NULL), 1) }) |