diff --git a/spec/migrations/swap_todos_note_id_to_bigint_for_self_managed_spec.rb b/spec/migrations/swap_todos_note_id_to_bigint_for_self_managed_spec.rb index d576ec23554a91f17134a50702aacb2a2120e08c..525e4fbcd8d7458e42b30904fc8303e96dbe4d4a 100644 --- a/spec/migrations/swap_todos_note_id_to_bigint_for_self_managed_spec.rb +++ b/spec/migrations/swap_todos_note_id_to_bigint_for_self_managed_spec.rb @@ -50,6 +50,11 @@ connection.execute('ALTER TABLE todos ADD COLUMN IF NOT EXISTS note_id_convert_to_bigint integer') end + after do + connection = described_class.new.connection + connection.execute('ALTER TABLE todos 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 @@ 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 todos 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)