summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-04-08 20:50:28 +0200
committerKamil Trzciński <ayufan@ayufan.eu>2019-04-08 20:52:33 +0200
commite3f211a6f5cb836d1f85fcb1ef438d98c2088a38 (patch)
treeec34c5de8830b9ce65931d245e3085a2d3c12cda /db
parenteb377b85def270e44ea476fc37c045c9a3de6473 (diff)
downloadgitlab-ce-e3f211a6f5cb836d1f85fcb1ef438d98c2088a38.tar.gz
Backport `add_default_project_creation_setting` to CEbackport-add-default-project-creation-setting
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180115094742_add_default_project_creation_setting.rb15
-rw-r--r--db/migrate/20190311132500_add_default_project_creation_application_setting.rb22
2 files changed, 15 insertions, 22 deletions
diff --git a/db/migrate/20180115094742_add_default_project_creation_setting.rb b/db/migrate/20180115094742_add_default_project_creation_setting.rb
new file mode 100644
index 00000000000..22de39e1672
--- /dev/null
+++ b/db/migrate/20180115094742_add_default_project_creation_setting.rb
@@ -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
diff --git a/db/migrate/20190311132500_add_default_project_creation_application_setting.rb b/db/migrate/20190311132500_add_default_project_creation_application_setting.rb
deleted file mode 100644
index 87427ad2930..00000000000
--- a/db/migrate/20190311132500_add_default_project_creation_application_setting.rb
+++ /dev/null
@@ -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