Fix data migration from trigger schedules
This commit is contained in:
parent
6a2bcb4b2a
commit
cf6ba755c6
1 changed files with 7 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue