diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-06 12:13:35 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-06 12:13:45 +0200 |
commit | 083c0e28f70dcf41b15fee20f7d3305f21f737ae (patch) | |
tree | cfd1e20f1fc23e0448f9baae1ee9decc8a6bc705 /db | |
parent | 52cc64a8a4dc224df9df85f7933f8922cf6cef24 (diff) | |
download | gitlab-ce-083c0e28f70dcf41b15fee20f7d3305f21f737ae.tar.gz |
Support empty PG database toozj-gitorious-migration-empty-pg-database
First check if there is a result on the migration, else there is
nothing to do
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb | 3 |
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 |