Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-01 19:00:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-01 19:00:51 +0300
commitb2e9603724fc002b87cc23926a613b4e7ab10a42 (patch)
tree53b0a2aa2157561545516f0d2baa50de81094fb5 /spec/migrations
parenta5131ced0f04bd5e8bc58fc54b60f5e93ed93b4c (diff)
Add latest changes from gitlab-org/gitlab@14-3-stable-ee
Diffstat (limited to 'spec/migrations')
-rw-r--r--spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb b/spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb
new file mode 100644
index 00000000000..362b4be1bc6
--- /dev/null
+++ b/spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!('finalize_ci_builds_bigint_conversion')
+
+RSpec.describe FinalizeCiBuildsBigintConversion, :migration, schema: 20210907182359 do
+ context 'with an unexpected FK fk_3f0c88d7dc' do
+ it 'removes the FK and migrates successfully' do
+ # Add the unexpected FK
+ subject.add_foreign_key(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_3f0c88d7dc')
+
+ expect { migrate! }.to change { subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_3f0c88d7dc') }.from(true).to(false)
+
+ # Additional check: The actually expected FK should still exist
+ expect(subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_be5624bf37')).to be_truthy
+ end
+ end
+end