First pass at multi-database for read replica using Rails native adapter (#25693)
Co-authored-by: emilweth <7402764+emilweth@users.noreply.github.com>
This commit is contained in:
parent
4534498a8e
commit
e4cfe4b3db
7 changed files with 36 additions and 26 deletions
|
@ -27,10 +27,20 @@ test:
|
|||
port: <%= ENV['DB_PORT'] %>
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] || 'mastodon_production' %>
|
||||
username: <%= ENV['DB_USER'] || 'mastodon' %>
|
||||
password: <%= (ENV['DB_PASS'] || '').to_json %>
|
||||
host: <%= ENV['DB_HOST'] || 'localhost' %>
|
||||
port: <%= ENV['DB_PORT'] || 5432 %>
|
||||
prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
|
||||
primary:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_NAME'] || 'mastodon_production' %>
|
||||
username: <%= ENV['DB_USER'] || 'mastodon' %>
|
||||
password: <%= (ENV['DB_PASS'] || '').to_json %>
|
||||
host: <%= ENV['DB_HOST'] || 'localhost' %>
|
||||
port: <%= ENV['DB_PORT'] || 5432 %>
|
||||
prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
|
||||
read:
|
||||
<<: *default
|
||||
database: <%= ENV['DB_REPLICA_NAME'] ||ENV['DB_NAME'] || 'mastodon_production' %>
|
||||
username: <%= ENV['DB_REPLICA_USER'] ||ENV['DB_USER'] || 'mastodon' %>
|
||||
password: <%= (ENV['DB_REPLICA_PASS'] || ENV['DB_PASS'] || '').to_json %>
|
||||
host: <%= ENV['DB_REPLICA_HOST'] ||ENV['DB_HOST'] || 'localhost' %>
|
||||
port: <%= ENV['DB_REPLICA_PORT'] ||ENV['DB_PORT'] || 5432 %>
|
||||
prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>
|
||||
replica: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue