30 lines
870 B
YAML
30 lines
870 B
YAML
# Database-oriented examples. Set the referenced environment variables before
|
|
# running these jobs; connection strings never belong in a job file.
|
|
version: 1
|
|
|
|
jobs:
|
|
snapshot-database:
|
|
command: convert
|
|
description: Read a PostgreSQL database and write a DBML snapshot
|
|
inputs:
|
|
- format: pgsql
|
|
conn_env: SOURCE_DB_URL
|
|
output:
|
|
format: dbml
|
|
path: build/database-snapshot.dbml
|
|
overwrite: true
|
|
|
|
apply-migrations:
|
|
command: scripts-exec
|
|
description: Execute migrations from core and tenant folders against PostgreSQL
|
|
# All SQL files from these directories are discovered in deterministic order.
|
|
script_dirs:
|
|
- migrations/core
|
|
- migrations/tenant
|
|
output:
|
|
format: pgsql
|
|
conn_env: TARGET_DB_URL
|
|
options:
|
|
continue_on_error: false
|
|
logfile: .relspec/log/apply-migrations.log
|