Skip to content

Commit

Permalink
patchwork database setup
Browse files Browse the repository at this point in the history
  • Loading branch information
aunghtetnay committed Apr 27, 2024
1 parent cfc2554 commit 0371825
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -85,19 +86,29 @@ 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' %>
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' %>
prepared_statements: <%= ENV['PREPARED_STATEMENTS'] || 'true' %>

0 comments on commit 0371825

Please sign in to comment.