Commit cf6ba755 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Fix data migration from trigger schedules

parent 6a2bcb4b
...@@ -4,6 +4,13 @@ class MigrateTriggerSchedulesToPipelineSchedules < ActiveRecord::Migration ...@@ -4,6 +4,13 @@ class MigrateTriggerSchedulesToPipelineSchedules < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def up 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 connection.execute <<-SQL
INSERT INTO ci_pipeline_schedules ( INSERT INTO ci_pipeline_schedules (
project_id, 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