From 03718255bb36ff7781d7a23483bf7dc9986bb38f Mon Sep 17 00:00:00 2001 From: Aung Htet Nay Date: Sat, 27 Apr 2024 20:54:25 +0630 Subject: [PATCH] patchwork database setup --- config/database.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/config/database.yml b/config/database.yml index 769ae65d..8ca53528 100644 --- a/config/database.yml +++ b/config/database.yml @@ -29,6 +29,7 @@ development: password: <%= (ENV['DB_PASS'] || '').to_json %> host: <%= ENV['DB_HOST'] || 'localhost' %> port: <%= ENV['DB_PORT'] || 5432 %> + prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> # The specified database role being used to connect to postgres. # To create additional roles in postgres see `$ createuser --help`. @@ -85,14 +86,24 @@ test: # for a full overview on how database connection configuration can be specified. # staging: - <<: *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' %> + primary_replica: + <<: *default + database: <%= ENV['DB_NAME'] || 'mastodon_production' %> + username: <%= ENV['DB_READ_ONLY_USER'] || 'mastodon' %> + password: <%= (ENV['DB_READ_ONLY_PASS'] || '').to_json %> + host: <%= ENV['DB_HOST_REPLICA'] || 'localhost' %> + port: <%= ENV['DB_PORT'] || 5432 %> + replica: true + production: <<: *default database: <%= ENV['DB_NAME'] || 'mastodon_production' %> @@ -100,4 +111,4 @@ production: password: <%= (ENV['DB_PASS'] || '').to_json %> host: <%= ENV['DB_HOST'] || 'localhost' %> port: <%= ENV['DB_PORT'] || 5432 %> - prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %> \ No newline at end of file + prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>