From e9ef5a78f52155660b7b2641266d32abb1de2732 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 18 Aug 2023 12:56:38 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-3-stable-ee --- ...epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb | 10 ++++++++++ ...4_swap_suggestions_note_id_to_bigint_for_self_hosts_spec.rb | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'spec/migrations') diff --git a/spec/migrations/20230809104753_swap_epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb b/spec/migrations/20230809104753_swap_epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb index 7dcd40db88a..a932de64819 100644 --- a/spec/migrations/20230809104753_swap_epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb +++ b/spec/migrations/20230809104753_swap_epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb @@ -50,6 +50,11 @@ RSpec.describe SwapEpicUserMentionsNoteIdToBigintForSelfHosts, feature_category: connection.execute('ALTER TABLE epic_user_mentions ADD COLUMN IF NOT EXISTS note_id_convert_to_bigint integer') end + after do + connection = described_class.new.connection + connection.execute('ALTER TABLE epic_user_mentions DROP COLUMN IF EXISTS note_id_convert_to_bigint') + end + it 'does not swap the columns' do # rubocop: disable RSpec/AnyInstanceOf allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) @@ -115,6 +120,11 @@ RSpec.describe SwapEpicUserMentionsNoteIdToBigintForSelfHosts, feature_category: BEGIN NEW."note_id_convert_to_bigint" := NEW."note_id"; RETURN NEW; END; $$;') end + after do + connection = described_class.new.connection + connection.execute('ALTER TABLE epic_user_mentions DROP COLUMN IF EXISTS note_id_convert_to_bigint') + end + it 'swaps the columns' do # rubocop: disable RSpec/AnyInstanceOf allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) diff --git a/spec/migrations/20230810103534_swap_suggestions_note_id_to_bigint_for_self_hosts_spec.rb b/spec/migrations/20230810103534_swap_suggestions_note_id_to_bigint_for_self_hosts_spec.rb index 79583fb0a21..f5afaf9eca9 100644 --- a/spec/migrations/20230810103534_swap_suggestions_note_id_to_bigint_for_self_hosts_spec.rb +++ b/spec/migrations/20230810103534_swap_suggestions_note_id_to_bigint_for_self_hosts_spec.rb @@ -50,6 +50,11 @@ RSpec.describe SwapSuggestionsNoteIdToBigintForSelfHosts, feature_category: :dat connection.execute('ALTER TABLE suggestions ADD COLUMN IF NOT EXISTS note_id_convert_to_bigint integer') end + after do + connection = described_class.new.connection + connection.execute('ALTER TABLE suggestions DROP COLUMN IF EXISTS note_id_convert_to_bigint') + end + it 'does not swap the columns' do # rubocop: disable RSpec/AnyInstanceOf allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) @@ -115,6 +120,11 @@ RSpec.describe SwapSuggestionsNoteIdToBigintForSelfHosts, feature_category: :dat BEGIN NEW."note_id_convert_to_bigint" := NEW."note_id"; RETURN NEW; END; $$;') end + after do + connection = described_class.new.connection + connection.execute('ALTER TABLE suggestions DROP COLUMN IF EXISTS note_id_convert_to_bigint') + end + it 'swaps the columns' do # rubocop: disable RSpec/AnyInstanceOf allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) -- cgit v1.2.3