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-19 11:55:46 -0700
commit1044930a527ef0db4e6e85b9b0d1d6b6ae00b268 (patch)
tree463e43d00f8bb9f246eb93a0fc9d14f11e46c1a6 /db
parentfaa8b69f2b6dd4d6d9117a9988d1232f94c418f1 (diff)
downloadgitlab-ce-1044930a527ef0db4e6e85b9b0d1d6b6ae00b268.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