@ -87,13 +87,12 @@ jobs:
# Verify that all PostgreSQL migrations apply cleanly to a fresh database.
# Verify that all PostgreSQL migrations apply cleanly to a fresh database.
# This catches broken SQL before it reaches a production deployment.
# This catches broken SQL before it reaches a production deployment.
# Restore src/db/schema.rs after running: diesel.toml has [print_schema]
# DIESEL_CONFIG_FILE=/dev/null disables the [print_schema] setting from
# configured, so diesel rewrites the file with backend-specific types after
# diesel.toml so that schema.rs is not overwritten during the check.
# migration. The checked-in schema.rs must be restored before compiling.
- name : Run PostgreSQL migrations
- name : Run PostgreSQL migrations
run : |
env:
diesel migration run --migration-dir migrations/postgresq l
DIESEL_CONFIG_FILE : /dev/nul l
git checkout -- src/db/schema.rs
run : diesel migration run --migration-dir migrations/postgresql
# Run the test suite with a live PostgreSQL instance available.
# Run the test suite with a live PostgreSQL instance available.
# Existing tests are unit tests (no DB access), but DATABASE_URL is set
# Existing tests are unit tests (no DB access), but DATABASE_URL is set
@ -157,11 +156,11 @@ jobs:
run : cargo install diesel_cli --no-default-features --features mysql
run : cargo install diesel_cli --no-default-features --features mysql
# Verify that all MySQL migrations apply cleanly to a fresh database.
# Verify that all MySQL migrations apply cleanly to a fresh database.
# Restore src/db/schema.rs for the same reason as the PostgreSQL job above .
# DIESEL_CONFIG_FILE=/dev/null for the same reason as the PostgreSQL job .
- name : Run MySQL migrations
- name : Run MySQL migrations
run : |
env:
diesel migration run --migration-dir migrations/mysq l
DIESEL_CONFIG_FILE : /dev/nul l
git checkout -- src/db/schema.rs
run : diesel migration run --migration-dir migrations/mysql
# Run the test suite with a live MySQL instance available.
# Run the test suite with a live MySQL instance available.
- name : Run tests (mysql)
- name : Run tests (mysql)