diff options
-rw-r--r-- | app/models/ci/stage.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/ci/pipeline/seed/stage.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/all_models.yml | 1 |
3 files changed, 3 insertions, 1 deletions
diff --git a/app/models/ci/stage.rb b/app/models/ci/stage.rb index 58f3fe2460a..0389945191e 100644 --- a/app/models/ci/stage.rb +++ b/app/models/ci/stage.rb @@ -14,6 +14,7 @@ module Ci has_many :statuses, class_name: 'CommitStatus', foreign_key: :stage_id has_many :builds, foreign_key: :stage_id + has_many :bridges, foreign_key: :stage_id with_options unless: :importing? do validates :project, presence: true diff --git a/lib/gitlab/ci/pipeline/seed/stage.rb b/lib/gitlab/ci/pipeline/seed/stage.rb index 015ca61d726..9c15064756a 100644 --- a/lib/gitlab/ci/pipeline/seed/stage.rb +++ b/lib/gitlab/ci/pipeline/seed/stage.rb @@ -41,7 +41,7 @@ module Gitlab ::Ci::Stage.new(attributes).tap do |stage| seeds.each do |seed| if seed.bridge? - stage.statuses << seed.to_resource + stage.bridges << seed.to_resource else stage.builds << seed.to_resource end diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index b641e144731..6897ac8a3a8 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -138,6 +138,7 @@ stages: - pipeline - statuses - builds +- bridges statuses: - project - pipeline |