gitlab-org--gitlab-foss/db/post_migrate/20161221140236_remove_unneeded_services.rb
Z.J. van de Weg 1812d523a3 Remove unused services from the database
This adds a migration to remove unused services, where the properties
are empty. As the properties are empty, those do not contain any
settings or other information.

Fixes #25727
2016-12-21 15:11:03 +01:00

13 lines
249 B
Ruby

class RemoveUnneededServices < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
execute("DELETE FROM services WHERE active = false AND properties = '{}';")
end
def down
# noop
end
end