Merge pull request #9800 from opf/feature/38671/reset-all-notifications
[38595] Reset all notification settings, remove previous migration attemptspull/9812/head
commit
98cc7d9f10
@ -0,0 +1,20 @@ |
||||
class DefaultNotificationSetting < ActiveRecord::Migration[6.1] |
||||
def up |
||||
NotificationSetting.delete_all |
||||
|
||||
execute <<~SQL.squish |
||||
INSERT INTO |
||||
notification_settings |
||||
(user_id, watched, involved, mentioned) |
||||
SELECT |
||||
id, true, true, true |
||||
FROM |
||||
users |
||||
WHERE type = 'User' |
||||
SQL |
||||
end |
||||
|
||||
def down |
||||
# No data to revert |
||||
end |
||||
end |
Loading…
Reference in new issue