Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to change DB name in dev/test #342

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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