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

20200305151736_delete_template_project_services.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2ab8d46a94ebcb163236daffbea668a281bc3b96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class DeleteTemplateProjectServices < ActiveRecord::Migration[6.0]
  DOWNTIME = false

  def up
    # In 12.9 an ActiveRecord validation for services not being a template and
    # attached to a project at the same time is introduced. This migration cleans up invalid data.
    execute <<~SQL
      DELETE
      FROM services
      WHERE TEMPLATE = TRUE AND project_id IS NOT NULL
    SQL
  end

  def down
    # This migration cannot be reversed.
  end
end