Skip to content

Commit 8cd94d3

Browse files
jmdeldinMisty Stanley-Jones
authored and
Misty Stanley-Jones
committed
Fix test DB creation in Compose's database.yml (docker#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.
1 parent 099178a commit 8cd94d3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

compose/rails.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,18 @@ align with the defaults set by the `postgres` image.
128128
Replace the contents of `config/database.yml` with the following:
129129

130130
```none
131-
development: &default
131+
default: &default
132132
adapter: postgresql
133133
encoding: unicode
134-
database: myapp_development
135-
pool: 5
134+
host: db
136135
username: postgres
137136
password:
138-
host: db
137+
pool: 5
138+
139+
development:
140+
<<: *default
141+
database: myapp_development
142+
139143
140144
test:
141145
<<: *default

0 commit comments

Comments
 (0)