2019-06-27 20:49:27 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
disable_ddl_transaction!
|
2019-06-28 20:31:47 +00:00
|
|
|
|
2019-06-27 20:49:27 +00:00
|
|
|
def up
|
|
|
|
unless column_exists?(:namespaces, :subgroup_creation_level)
|
2019-06-28 20:31:47 +00:00
|
|
|
add_column_with_default(:namespaces,
|
|
|
|
:subgroup_creation_level,
|
|
|
|
:integer,
|
|
|
|
default: 0)
|
2019-06-30 21:40:23 +00:00
|
|
|
change_column_default(:namespaces, :subgroup_creation_level, 1)
|
2019-06-27 20:49:27 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
if column_exists?(:namespaces, :subgroup_creation_level)
|
|
|
|
remove_column(:namespaces, :subgroup_creation_level)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|