diff options
-rw-r--r-- | db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 11 insertions, 6 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 3342744ba93..b7b6e9b3484 100644 --- a/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb +++ b/db/migrate/20160902122721_drop_gitorious_field_from_application_settings.rb @@ -7,11 +7,16 @@ class DropGitoriousFieldFromApplicationSettings < ActiveRecord::Migration def up require 'yaml' - 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 + import_sources = connection.execute('SELECT import_sources FROM application_settings;') + + yaml = if Gitlab::Database.postgresql? + import_sources.values[0][0] + else + return unless import_sources.first + + import_sources.first[0] + end + yaml = YAML.safe_load(yaml) yaml.delete 'gitorious' diff --git a/db/schema.rb b/db/schema.rb index 5c283141084..c9023a02c77 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: 20160902122721) do +ActiveRecord::Schema.define(version: 20160901141443) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" |