Commit 5b6a7b1c authored by Sean Arnold's avatar Sean Arnold

Remove down method in migration

parent 0aa33c7a
......@@ -46,15 +46,6 @@ class MigrateServicesToHttpIntegrations < ActiveRecord::Migration[6.0]
end
def down
sql = <<~SQL
SELECT project_id FROM services
WHERE type = '#{ALERT_SERVICE_TYPE}'
SQL
select_values(sql).each do |project_id|
HttpIntegration
.where(project_id: project_id, endpoint_identifier: SERVICE_NAMES_IDENTIFIER[:identifier])
.delete_all
end
# no-op
end
end
......@@ -23,20 +23,4 @@ RSpec.describe MigrateServicesToHttpIntegrations do
expect(http_integration.endpoint_identifier).to eq(described_class::SERVICE_NAMES_IDENTIFIER[:identifier])
end
end
describe '#down' do
before do
http_integrations.create!(
project_id: project.id,
name: described_class::SERVICE_NAMES_IDENTIFIER[:name],
endpoint_identifier: described_class::SERVICE_NAMES_IDENTIFIER[:identifier],
encrypted_token: 'test',
encrypted_token_iv: 'test'
)
end
it 'removes the existing http integrations' do
expect { described_class.new.down }.to change { http_integrations.count }.from(1).to(0)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment