Change `DB_REPLICA_*` environment variables to `REPLICA_DB_*` (#26386)

This commit is contained in:
Claire 2023-08-08 13:59:40 +02:00 committed by GitHub
parent 4773d7b9aa
commit 2c204d904b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ class ApplicationRecord < ActiveRecord::Base
include Remotable include Remotable
connects_to database: { writing: :primary, reading: ENV['DB_REPLICA_NAME'] || ENV['REPLICA_DATABASE_URL'] ? :replica : :primary } connects_to database: { writing: :primary, reading: ENV['REPLICA_DB_NAME'] || ENV['REPLICA_DATABASE_URL'] ? :replica : :primary }
class << self class << self
def update_index(_type_name, *_args, &_block) def update_index(_type_name, *_args, &_block)

View File

@ -55,10 +55,10 @@ production:
prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
replica: replica:
<<: *default <<: *default
database: <%= ENV['DB_REPLICA_NAME'] ||ENV['DB_NAME'] || 'mastodon_production' %> database: <%= ENV['REPLICA_DB_NAME'] ||ENV['DB_NAME'] || 'mastodon_production' %>
username: <%= ENV['DB_REPLICA_USER'] ||ENV['DB_USER'] || 'mastodon' %> username: <%= ENV['REPLICA_DB_USER'] ||ENV['DB_USER'] || 'mastodon' %>
password: <%= (ENV['DB_REPLICA_PASS'] || ENV['DB_PASS'] || '').to_json %> password: <%= (ENV['REPLICA_DB_PASS'] || ENV['DB_PASS'] || '').to_json %>
host: <%= ENV['DB_REPLICA_HOST'] ||ENV['DB_HOST'] || 'localhost' %> host: <%= ENV['REPLICA_DB_HOST'] ||ENV['DB_HOST'] || 'localhost' %>
port: <%= ENV['DB_REPLICA_PORT'] ||ENV['DB_PORT'] || 5432 %> port: <%= ENV['REPLICA_DB_PORT'] ||ENV['DB_PORT'] || 5432 %>
prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
replica: true replica: true