Merge branch 'backport-add-default-project-creation-setting' into 'master'

Backport `add_default_project_creation_setting` to CE

See merge request gitlab-org/gitlab-ce!27141
This commit is contained in:
Michael Kozono 2019-04-08 20:13:50 +00:00
commit 225edb0d2d
2 changed files with 15 additions and 22 deletions

View File

@ -0,0 +1,15 @@
class AddDefaultProjectCreationSetting < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_column_with_default(:application_settings, :default_project_creation, :integer, default: 2)
end
def down
remove_column(:application_settings, :default_project_creation)
end
end

View File

@ -1,22 +0,0 @@
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddDefaultProjectCreationApplicationSetting < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
unless column_exists?(:application_settings, :default_project_creation)
add_column(:application_settings, :default_project_creation, :integer, default: 2, null: false)
end
end
def down
if column_exists?(:application_settings, :default_project_creation)
remove_column(:application_settings, :default_project_creation)
end
end
end