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>2022-05-13 18:07:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-13 18:07:43 +0300
commit7eca3f56625526ffa7f263c1fef0fcea34de8ca6 (patch)
treefec87c2a902e3c44f89963f4b28e6de32c0806f3 /lib/gitlab/database.rb
parent988424215cf104d9ee24bb1751141424cffb32d1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/database.rb')
-rw-r--r--lib/gitlab/database.rb17
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index 1895f0fab32..677b4485288 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -49,7 +49,7 @@ module Gitlab
# It does not include the default public schema
EXTRA_SCHEMAS = [DYNAMIC_PARTITIONS_SCHEMA, STATIC_PARTITIONS_SCHEMA].freeze
- PRIMARY_DATABASE_NAME = ActiveRecord::Base.connection_db_config.name.to_sym
+ PRIMARY_DATABASE_NAME = ActiveRecord::Base.connection_db_config.name.to_sym # rubocop:disable Database/MultipleDatabases
def self.database_base_models
@database_base_models ||= {
@@ -94,21 +94,6 @@ module Gitlab
Gitlab::Application.config.database_configuration[Rails.env].include?(database_name.to_s)
end
- def self.main_database?(name)
- # The database is `main` if it is a first entry in `database.yml`
- # Rails internally names them `primary` to avoid confusion
- # with broad `primary` usage we use `main` instead
- #
- # TODO: The explicit `== 'main'` is needed in a transition period till
- # the `database.yml` is not migrated into `main:` syntax
- # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65243
- ActiveRecord::Base.configurations.primary?(name.to_s) || name.to_s == 'main'
- end
-
- def self.ci_database?(name)
- name.to_s == CI_DATABASE_NAME
- end
-
class PgUser < ApplicationRecord
self.table_name = 'pg_user'
self.primary_key = :usename