summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-06 14:07:57 +0000
committerRémy Coutable <remy@rymai.me>2016-09-06 14:07:57 +0000
commit83cd3d79ea306dbcb1ed6f74b9591cb580b94fc6 (patch)
tree96915ca46cfbb8f823d224a60dc429cd5336a71f
parente9e8c67fb7d58288dbac1777b63ea7d3128d6268 (diff)
parent083c0e28f70dcf41b15fee20f7d3305f21f737ae (diff)
downloadgitlab-ce-83cd3d79ea306dbcb1ed6f74b9591cb580b94fc6.tar.gz
Merge branch 'zj-gitorious-migration-empty-pg-database' into 'master'
Support empty PG database too cc @rdavila @axil See merge request !6221
-rw-r--r--db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb3
1 files changed, 1 insertions, 2 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 b7b6e9b3484..a80a57254dd 100644
--- a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
+++ b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb
@@ -8,12 +8,11 @@ class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration
require 'yaml'
import_sources = connection.execute('SELECT import_sources FROM application_settings;')
+ return unless import_sources.first # support empty databases
yaml = if Gitlab::Database.postgresql?
import_sources.values[0][0]
else
- return unless import_sources.first
-
import_sources.first[0]
end