summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorFabio Papa <fabtheman@gmail.com>2019-06-27 13:49:27 -0700
committerFabio Papa <fabtheman@gmail.com>2019-07-02 11:36:02 -0700
commit1f4d2ab096284187d92d00f40ebea4df961b2c8e (patch)
treeb636360b309ab8bd5241ed62f4e10430fb022e47 /db
parentb6ce065f4b0476933845ba265e0fe92fb24d1e6e (diff)
downloadgitlab-ce-1f4d2ab096284187d92d00f40ebea4df961b2c8e.tar.gz
Add a subgroup_creation_level column to the namespaces table
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb20
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