summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-09-02 22:36:20 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-09-05 19:15:22 +0200
commite683eecdd99748f4b08359e2e979f94bf8ab5792 (patch)
tree9a080959d6d3a445f855ed5e20de1076f9079c86 /db
parent2246218cc00e1f8db92cae7234131ca00943f567 (diff)
downloadgitlab-ce-e683eecdd99748f4b08359e2e979f94bf8ab5792.tar.gz
Support MySQL too, when removing gitorious from import_sources
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
index 5395d38ea8f..3342744ba93 100644
--- a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
+++ b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
@@ -7,7 +7,11 @@ class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration
def up
require 'yaml'
- yaml = connection.execute('SELECT import_sources FROM application_settings;').values[0][0]
+ yaml = if Gitlab::Database.postgresql?
+ connection.execute('SELECT import_sources FROM application_settings;').values[0][0]
+ else
+ connection.execute('SELECT import_sources FROM application_settings;').first[0]
+ end
yaml = YAML.safe_load(yaml)
yaml.delete 'gitorious'