use DATABASE_URL for database configuration

This commit is contained in:
Justin Edmund 2025-11-30 20:19:40 -08:00
parent 916b72d58d
commit 8aedb36fac

View file

@ -1,21 +1,17 @@
default: &default
adapter: postgresql
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: <%= ENV['PGHOST'] %>
port: <%= ENV['PGPORT'] %>
username: <%= ENV['PGUSER'] %>
password: <%= ENV['PGPASSWORD'] %>
encoding: utf8
timeout: 5000
production:
<<: *default
database: <%= ENV['PGDATABASE'] %>
url: <%= ENV['DATABASE_URL'] %>
development:
<<: *default
database: hensei_dev
url: <%= ENV.fetch('DATABASE_URL', 'postgres://localhost/hensei_dev') %>
test:
<<: *default
database: hensei_test
url: <%= ENV.fetch('DATABASE_URL', 'postgres://localhost/hensei_test') %>