Commit 1ea1bb6e authored by Rémy Coutable's avatar Rémy Coutable Committed by Ruben Davila

Merge branch 'zj-gitorious-migration-empty-pg-database' into 'master'

Support empty PG database too

cc @rdavila @axil

See merge request !6221
parent 29114fea
...@@ -8,12 +8,11 @@ class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration ...@@ -8,12 +8,11 @@ class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration
require 'yaml' require 'yaml'
import_sources = connection.execute('SELECT import_sources FROM application_settings;') import_sources = connection.execute('SELECT import_sources FROM application_settings;')
return unless import_sources.first # support empty databases
yaml = if Gitlab::Database.postgresql? yaml = if Gitlab::Database.postgresql?
import_sources.values[0][0] import_sources.values[0][0]
else else
return unless import_sources.first
import_sources.first[0] import_sources.first[0]
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment