Commit a009e763 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'zj-fix-migration' into 'master'

Fix data migration from trigger schedules

See merge request !11460
parents fb31c6ce cf6ba755
......@@ -4,6 +4,13 @@ class MigrateTriggerSchedulesToPipelineSchedules < ActiveRecord::Migration
DOWNTIME = false
def up
connection.execute <<~SQL
DELETE FROM ci_trigger_schedules WHERE NOT EXISTS
(SELECT true FROM projects
WHERE ci_trigger_schedules.project_id = projects.id
)
SQL
connection.execute <<-SQL
INSERT INTO ci_pipeline_schedules (
project_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment