Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20160527020117_remove_notification_settings_for_deleted_projects.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3e26be7c09c0b6f1db90535e4845caac06286c60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# rubocop:disable all
class RemoveNotificationSettingsForDeletedProjects < ActiveRecord::Migration
  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