From 8cd94d3873691f21652fd7a190074bb4e606a38f Mon Sep 17 00:00:00 2001 From: Jon-Michael Deldin Date: Tue, 20 Jun 2017 13:55:06 -0700 Subject: [PATCH] Fix test DB creation in Compose's database.yml (#3123) Without the host and credentials, the `myapp_test` database is not created, and instead, the user receives a PG error and a long backtrace. This commit moves the credentials to a default anchor to share across development and test environments. --- compose/rails.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/compose/rails.md b/compose/rails.md index 68582a347f..f687ee8006 100644 --- a/compose/rails.md +++ b/compose/rails.md @@ -128,14 +128,18 @@ align with the defaults set by the `postgres` image. Replace the contents of `config/database.yml` with the following: ```none -development: &default +default: &default adapter: postgresql encoding: unicode - database: myapp_development - pool: 5 + host: db username: postgres password: - host: db + pool: 5 + +development: + <<: *default + database: myapp_development + test: <<: *default