diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-05-08 17:47:09 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-05-08 17:47:09 +0200 |
commit | fc8221ce6cae99326a0a519daa0ca7abe27e2728 (patch) | |
tree | 99cd4e716506a3ad8727fd986c354086fb39800b /db | |
parent | 8624a4eddec214a4092c34202bfc0cc92e72eb19 (diff) | |
download | gitlab-ce-fc8221ce6cae99326a0a519daa0ca7abe27e2728.tar.gz |
Reduce scope of orphaned builds to be removed
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180420010016_add_pipeline_build_foreign_key.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb b/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb index 7fcd3b20d5e..6fabe07bc9c 100644 --- a/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb +++ b/db/migrate/20180420010016_add_pipeline_build_foreign_key.rb @@ -13,7 +13,7 @@ class AddPipelineBuildForeignKey < ActiveRecord::Migration execute <<~SQL DELETE FROM ci_builds WHERE NOT EXISTS (SELECT true FROM ci_pipelines WHERE ci_pipelines.id = ci_builds.commit_id) - AND commit_id IS NOT NULL + AND stage_id IS NULL SQL add_concurrent_foreign_key(:ci_builds, :ci_pipelines, column: :commit_id) |