Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2016-12-21 16:43:39 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-12-21 17:11:03 +0300
commit1812d523a316e3f495ae48504b48f3049628fe75 (patch)
tree392315d5bcc4b5d3790626d86de303699c70dae0 /db
parent1548f7e02f455576ba17a51c78cdb4a66f3e5f68 (diff)
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
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20161221140236_remove_unneeded_services.rb13
-rw-r--r--db/schema.rb2
2 files changed, 14 insertions, 1 deletions
diff --git a/db/post_migrate/20161221140236_remove_unneeded_services.rb b/db/post_migrate/20161221140236_remove_unneeded_services.rb
new file mode 100644
index 00000000000..a94ccc43a41
--- /dev/null
+++ b/db/post_migrate/20161221140236_remove_unneeded_services.rb
@@ -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
diff --git a/db/schema.rb b/db/schema.rb
index 13a847827cc..05b6c807660 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -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"