Skip to content

Commit

Permalink
Merge pull request #342 from codeforjapan/modify-db-name
Browse files Browse the repository at this point in the history
Allow to change DB name in dev/test
  • Loading branch information
ayuki-joto authored Feb 21, 2022
2 parents b9d81bb + 387020f commit 54d42c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ default: &default

development:
<<: *default
database: decidim-app_development
database: <%= ENV.fetch("DATABASE_DBNAME_DEV") { "decidim-app_development" } %>

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
Expand Down Expand Up @@ -63,7 +63,7 @@ development:
# Do not set this db to the same as development or production.
test:
<<: *default
database: decidim-app_test
database: <%= ENV.fetch("DATABASE_DBNAME_TEST") { "decidim-app_test" } %>

# As with config/secrets.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
Expand Down
8 changes: 8 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export DATABASE_USERNAME=<yourname>
export DATABASE_PASSWORD=<yourpassword>
```

なお、DBのhost、port、DB名も設定したい場合は、以下のように環境変数を指定します。

```
export DATABASE_HOST=<yourhost>
export DATABASE_PORT=<yourport>
export DATABASE_DBNAME_DEV=<yourdbname>
```

### 2.6 bundle install
```
bundle install
Expand Down

0 comments on commit 54d42c3

Please sign in to comment.