diff options
author | Fabio Papa <fabtheman@gmail.com> | 2019-06-27 13:49:27 -0700 |
---|---|---|
committer | Fabio Papa <fabtheman@gmail.com> | 2019-06-27 15:52:36 -0700 |
commit | 521d4c76db6d18468bdee6d28d5dc408c7c7a09f (patch) | |
tree | dc00c75a7520cdfeaa850cf3703b3d3c9fdb72cd | |
parent | a1b9ace31ee0d9c602cb266e9bf94f2e37b14ce7 (diff) | |
download | gitlab-ce-521d4c76db6d18468bdee6d28d5dc408c7c7a09f.tar.gz |
Add a subgroup_creation_level column to the namespaces table
-rw-r--r-- | db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb new file mode 100644 index 00000000000..b0ea74d4765 --- /dev/null +++ b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + disable_ddl_transaction! + + def up + unless column_exists?(:namespaces, :subgroup_creation_level) + add_column_with_default(:namespaces, :subgroup_creation_level, :integer, default: 0) + end + end + + def down + if column_exists?(:namespaces, :subgroup_creation_level) + remove_column(:namespaces, :subgroup_creation_level) + end + end +end |