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:
Diffstat (limited to 'lib/gitlab/database/migration_helpers/announce_database.rb')
-rw-r--r--lib/gitlab/database/migration_helpers/announce_database.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/gitlab/database/migration_helpers/announce_database.rb b/lib/gitlab/database/migration_helpers/announce_database.rb
new file mode 100644
index 00000000000..28710aab717
--- /dev/null
+++ b/lib/gitlab/database/migration_helpers/announce_database.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Database
+ module MigrationHelpers
+ module AnnounceDatabase
+ extend ActiveSupport::Concern
+
+ def write(text = "")
+ if text.present? # announce/say
+ super("#{db_config_name}: #{text}")
+ else
+ super(text)
+ end
+ end
+
+ def db_config_name
+ @db_config_name ||= Gitlab::Database.db_config_name(connection)
+ end
+ end
+ end
+ end
+end