Skip to content

Instantly share code, notes, and snippets.

@oxanayoxana
Created July 14, 2019 12:03
Show Gist options
  • Save oxanayoxana/6fc1dfebb3e821a9b14575c399d3cc35 to your computer and use it in GitHub Desktop.
Save oxanayoxana/6fc1dfebb3e821a9b14575c399d3cc35 to your computer and use it in GitHub Desktop.
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: <%= ENV.fetch('DATABASE_HOST', '127.0.0.1') %>
port: <%= ENV.fetch('DATABASE_PORT', 5432) %>
username: <%= ENV.fetch('DATABASE_USERNAME', 'postgres') %>
password: <%= ENV['DATABASE_PASSWORD'] %>
development:
<<: *default
database: <%= "#{ENV.fetch('DATABASE_NAME') { ENV.fetch('APP_NAME', 'application') }.dup.concat('_development')}" %>
test:
<<: *default
database: <%= "#{ENV.fetch('DATABASE_NAME') { ENV.fetch('APP_NAME', 'application') }.dup.concat('_test')}#{ENV['TEST_ENV_NUMBER']}" %>
production:
<<: *default
database: <%= ENV.fetch('DATABASE_NAME') { ENV.fetch('APP_NAME', 'application').dup.concat('_production') } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment