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
This commit is contained in:
parent
1548f7e02f
commit
1812d523a3
3 changed files with 18 additions and 1 deletions
4
changelogs/unreleased/zj-remove-unused-services.yml
Normal file
4
changelogs/unreleased/zj-remove-unused-services.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Remove unused and void services from the database
|
||||
merge_request:
|
||||
author:
|
13
db/post_migrate/20161221140236_remove_unneeded_services.rb
Normal file
13
db/post_migrate/20161221140236_remove_unneeded_services.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
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
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20161220141214) do
|
||||
ActiveRecord::Schema.define(version: 20161221140236) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
Loading…
Reference in a new issue