summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-14 06:09:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-14 06:09:14 +0000
commit8c558095790d0b9ae67344a05975f1f84f8df837 (patch)
tree786c71e2d3d57c18ef4917e83423d0fcf609a70a /db
parent8957ace3159e5369a700a77614493ed6a8a98f93 (diff)
downloadgitlab-ce-8c558095790d0b9ae67344a05975f1f84f8df837.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200305151736_delete_template_project_services.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200305151736_delete_template_project_services.rb b/db/migrate/20200305151736_delete_template_project_services.rb
new file mode 100644
index 00000000000..2ab8d46a94e
--- /dev/null
+++ b/db/migrate/20200305151736_delete_template_project_services.rb
@@ -0,0 +1,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