Skip to content

Commit

Permalink
Use --yes flag for migrations everywhere
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <[email protected]>
  • Loading branch information
aeneasr committed Apr 27, 2019
1 parent 2c09d20 commit c7e7aa0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
9 changes: 9 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ secure deployment with zero effort? We can run it for you! If you're interested,

## 1.0.0-rc.10

### Schema Changes

Please read all paragraphs of this section with the utmost care, before executing `hydra migrate sql`. Do
not take this change lightly and create a backup of the database before you begin. To be sure, copy the database
and do a dry-run locally.

> Be aware that running these migrations might take some time when using large databases. Do a dry-run before hammering
your production database.

### SQL Migrations now require user-input or `--yes` flag

`hydra migrate sql` now shows an execution plan and asks for confirmation before executing the migrations. To run
Expand Down
2 changes: 1 addition & 1 deletion quickstart-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
environment:
- DSN=mysql://root:secret@tcp(mysqld:3306)/mysql?max_conns=20&max_idle_conns=4
command:
migrate sql -e
migrate sql -e --yes
restart: on-failure

hydra:
Expand Down
2 changes: 1 addition & 1 deletion quickstart-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
environment:
- DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
command:
migrate sql -e
migrate sql -e --yes
restart: on-failure

hydra:
Expand Down
7 changes: 4 additions & 3 deletions test/e2e/circle-ci.bash
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ case "$1" in
;;

postgres)
hydra migrate sql $TEST_DATABASE_POSTGRESQL
hydra migrate sql --yes $TEST_DATABASE_POSTGRESQL
DSN=$TEST_DATABASE_POSTGRESQL \
hydra serve all --dangerous-force-http --disable-telemetry >> ./hydra.e2e.log 2>&1 &
export CYPRESS_jwt_enabled=false
;;

postgres-jwt)
hydra migrate sql $TEST_DATABASE_POSTGRESQL
hydra migrate sql --yes $TEST_DATABASE_POSTGRESQL
DSN=$TEST_DATABASE_POSTGRESQL \
OAUTH2_ACCESS_TOKEN_STRATEGY=jwt \
OIDC_SUBJECT_IDENTIFIERS_ENABLED=public \
Expand All @@ -58,13 +58,14 @@ case "$1" in
;;

mysql)
hydra migrate sql $TEST_DATABASE_MYSQL
hydra migrate sql --yes $TEST_DATABASE_MYSQL
DSN=$TEST_DATABASE_MYSQL \
hydra serve all --dangerous-force-http --disable-telemetry >> ./hydra.e2e.log 2>&1 &
export CYPRESS_jwt_enabled=false
;;

mysql-jwt)
hydra migrate sql --yes $TEST_DATABASE_MYSQL
DSN=$TEST_DATABASE_MYSQL \
OAUTH2_ACCESS_TOKEN_STRATEGY=jwt \
OIDC_SUBJECT_IDENTIFIERS_ENABLED=public \
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
environment:
- DSN=mysql://root:secret@tcp(mysqld:3306)/mysql?max_conns=20&max_idle_conns=4
command:
migrate sql -e
migrate sql -e --yes
restart: on-failure

hydra:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/docker-compose.postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
environment:
- DSN=postgres://hydra:secret@postgresd:5432/hydra?sslmode=disable&max_conns=20&max_idle_conns=4
command:
migrate sql -e
migrate sql -e --yes
restart: on-failure

hydra:
Expand Down

0 comments on commit c7e7aa0

Please sign in to comment.