Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-06 15:11:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-06 15:11:14 +0300
commitab7ca19e6844c37a715e378801409e297fd51512 (patch)
treecc09891376cf53f63fd17bb6f739295620cf1ac1 /lib/gitlab
parentaea64c367b180ea549aa115d8312b7c1832bc0b3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/database/async_indexes/migration_helpers.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/database/async_indexes/migration_helpers.rb b/lib/gitlab/database/async_indexes/migration_helpers.rb
index 0afb47ef16d..2f990aba2fb 100644
--- a/lib/gitlab/database/async_indexes/migration_helpers.rb
+++ b/lib/gitlab/database/async_indexes/migration_helpers.rb
@@ -55,11 +55,14 @@ module Gitlab
schema_creation = ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaCreation.new(ApplicationRecord.connection)
definition = schema_creation.accept(create_index)
- async_index = PostgresAsyncIndex.safe_find_or_create_by!(name: index_name) do |rec|
+ async_index = PostgresAsyncIndex.find_or_create_by!(name: index_name) do |rec|
rec.table_name = table_name
rec.definition = definition
end
+ async_index.definition = definition
+ async_index.save! # No-op if definition is not changed
+
Gitlab::AppLogger.info(
message: 'Prepared index for async creation',
table_name: async_index.table_name,