blob: c530c09859d406ea6827efeb8744601782e4c3e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
class RemoveNotificationSettingsForDeletedProjects < ActiveRecord::Migration[4.2]
def up
execute <<-SQL
DELETE FROM notification_settings
WHERE notification_settings.source_type = 'Project'
AND NOT EXISTS (
SELECT *
FROM projects
WHERE projects.id = notification_settings.source_id
)
SQL
end
end
|