# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
#
default: &default
  adapter: sqlite3
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000

development:
  prepared_statements: false
  adapter: postgresql
  database: <%= ENV.fetch('POSTGRES_DATABASE', 'chaskiq_dev') %>
  username: <%= ENV.fetch('POSTGRES_USERNAME', 'postgres') %>
  password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
  min_messages: warning
  pool: 15
  timeout: 5000
  host_names:
    ### Don't include the port number here. Change the "port" site setting instead, at /admin/site_settings.
    ### If you change this setting you will need to
    ###   - restart sidekiq if you change this setting
    ###   - rebake all to posts using: `RAILS_ENV=production bundle exec rake posts:rebake`
    - "localhost"


# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  prepared_statements: false
  adapter: postgresql
  database: <%= ENV.fetch('POSTGRES_DATABASE', 'chaskiq_test') %>
  username: <%= ENV.fetch('POSTGRES_USERNAME', 'postgres') %>
  password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
  min_messages: warning
  pool: 5
  timeout: 5000
  host_names:
    ### Don't include the port number here. Change the "port" site setting instead, at /admin/site_settings.
    ### If you change this setting you will need to
    ###   - restart sidekiq if you change this setting
    ###   - rebake all to posts using: `RAILS_ENV=production bundle exec rake posts:rebake`
    - "localhost"


production:
  <<: *default
  database: <%= ENV.fetch('POSTGRES_DATABASE', 'chaskiq_production') %>
  username: <%= ENV.fetch('POSTGRES_USERNAME', 'chaskiq_prod') %>
  password: <%= ENV.fetch('POSTGRES_PASSWORD', 'chaskiq_prod') %>
  prepared_statements: false
  adapter: postgresql
  min_messages: warning
  host_names:
    ### Don't include the port number here. Change the "port" site setting instead, at /admin/site_settings.
    ### If you change this setting you will need to
    ###   - restart sidekiq if you change this setting
    ###   - rebake all to posts using: `RAILS_ENV=production bundle exec rake posts:rebake`
    - "localhost"
