common: &common
  adapter: postgresql
  host: <%= ENV.fetch('CANVAS_DATABASE_HOST', 'postgres') %>
  password: <%= ENV.fetch('POSTGRES_PASSWORD') %>
  encoding: utf8
  username: <%= ENV.fetch('CANVAS_DATABASE_USERNAME', 'postgres') %>
  timeout: 5000
  prepared_statements: false
  use_qualified_names: true
  shard_name: public
  schema_search_path: "''"

production:
  <<: *common
  database: <%= ENV.fetch('CANVAS_DATABASE_PRODUCTION', 'canvas_production') %>

development:
  <<: *common
  database: <%= ENV.fetch('CANVAS_DATABASE_DEVELOPMENT', 'canvas_development') %>

test:
  <<: *common
  database: <%= ENV.fetch('CANVAS_DATABASE_TEST', 'canvas_test') %>
  shard1: canvas_test_shard_1
  shard2: canvas_test_shard_2
  test_shard_1: canvas_test_shard_1
  test_shard_2: canvas_test_shard_2
