diff options
2 files changed, 20 insertions, 0 deletions
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) |