summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-04-05 08:42:40 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-04-05 08:42:40 +0000
commit2bf4fefd12aa9ff8a757f7de8280e11cdb68bc96 (patch)
tree8b225f13c909a2244f4e60af2e19654c77244aaa /db
parentbf97a01dae22a0e1b9b6574ad0fd74883e4f964f (diff)
parentf37f28b962376843e7682dad15067edb131ecdd8 (diff)
downloadgitlab-ce-2bf4fefd12aa9ff8a757f7de8280e11cdb68bc96.tar.gz
Merge branch '59162-fix-review-apps-initial-seeding' into 'master'
Fix race condition in ApplicationSettingImplementation.create_from_defaults Closes #59162 See merge request gitlab-org/gitlab-ce!26319
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/02_application_settings.rb10
-rw-r--r--db/fixtures/development/02_settings.rb8
-rw-r--r--db/fixtures/development/08_settings.rb7
-rw-r--r--db/fixtures/production/001_application_settings.rb2
4 files changed, 12 insertions, 15 deletions
diff --git a/db/fixtures/development/02_application_settings.rb b/db/fixtures/development/02_application_settings.rb
new file mode 100644
index 00000000000..d604f0be3cd
--- /dev/null
+++ b/db/fixtures/development/02_application_settings.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+puts "Creating the default ApplicationSetting record.".color(:green)
+Gitlab::CurrentSettings.current_application_settings
+
+# Details https://gitlab.com/gitlab-org/gitlab-ce/issues/46241
+puts "Enable hashed storage for every new projects.".color(:green)
+ApplicationSetting.current_without_cache.update!(hashed_storage_enabled: true)
+
+print '.'
diff --git a/db/fixtures/development/02_settings.rb b/db/fixtures/development/02_settings.rb
deleted file mode 100644
index 3a4a5d436bf..00000000000
--- a/db/fixtures/development/02_settings.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-# Enable hashed storage, in development mode, for all projects by default.
-Gitlab::Seeder.quiet do
- ApplicationSetting.create_from_defaults unless ApplicationSetting.current_without_cache
- ApplicationSetting.current_without_cache.update!(hashed_storage_enabled: true)
- print '.'
-end
diff --git a/db/fixtures/development/08_settings.rb b/db/fixtures/development/08_settings.rb
deleted file mode 100644
index 141465c06cf..00000000000
--- a/db/fixtures/development/08_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# We want to enable hashed storage for every new project in development
-# Details https://gitlab.com/gitlab-org/gitlab-ce/issues/46241
-Gitlab::Seeder.quiet do
- ApplicationSetting.create_from_defaults unless ApplicationSetting.current_without_cache
- ApplicationSetting.current_without_cache.update!(hashed_storage_enabled: true)
- print '.'
-end
diff --git a/db/fixtures/production/001_application_settings.rb b/db/fixtures/production/001_application_settings.rb
index ab15717e9a9..cf647650142 100644
--- a/db/fixtures/production/001_application_settings.rb
+++ b/db/fixtures/production/001_application_settings.rb
@@ -1,2 +1,4 @@
+# frozen_string_literal: true
+
puts "Creating the default ApplicationSetting record.".color(:green)
Gitlab::CurrentSettings.current_application_settings