Commit 00236339 authored by Michael Kozono's avatar Michael Kozono

Add default to authorized_keys_enabled setting

Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless.

Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column.

The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0.
parent f6ace56e
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddDefaultToAuthorizedKeysEnabledApplicationSetting < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
change_column :application_settings, :authorized_keys_enabled, :boolean, default: true
change_column_null :application_settings, :authorized_keys_enabled, false, true
end
def down
change_column_null :application_settings, :authorized_keys_enabled, true
change_column :application_settings, :authorized_keys_enabled, :boolean, default: nil
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170626202753) do
ActiveRecord::Schema.define(version: 20170627211700) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -141,7 +141,7 @@ ActiveRecord::Schema.define(version: 20170626202753) do
t.integer "mirror_max_delay", default: 5, null: false
t.integer "mirror_max_capacity", default: 100, null: false
t.integer "mirror_capacity_threshold", default: 50, null: false
t.boolean "authorized_keys_enabled"
t.boolean "authorized_keys_enabled", default: true, null: false
t.boolean "help_page_hide_commercial_content", default: false
t.string "help_page_support_url"
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