scripts/apply-migrations.sh
Metadata
- Purpose: Automation script used in local development, CI, or deployment flow.
- Domain:
scripts - Language:
bash - Bytes: 702
- Lines: 26
- Content hash (short):
e4e87597 - Source (start): scripts/apply-migrations.sh:1
- Source (end): scripts/apply-migrations.sh:26
Indexed Symbols
No indexed functions/methods detected in this file.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
#!/usr/bin/env bash
set -euo pipefail
if [[ -z "${DATABASE_URL:-}" ]]; then
echo "DATABASE_URL is required"
exit 1
fi
for migration in \
infra/sql/0001_init.sql \
infra/sql/0002_psa_resources.sql \
infra/sql/0003_idempotency.sql \
infra/sql/0004_event_pipeline.sql \
infra/sql/0005_job_queue.sql \
infra/sql/0006_security_hardening.sql \
infra/sql/0007_configuration_plane.sql \
infra/sql/0008_job_metadata.sql \
infra/sql/0009_workflow_execution_metadata.sql \
infra/sql/0010_worker_runtime.sql \
infra/sql/0011_portal_invites.sql; do
echo "Applying ${migration}"
psql "${DATABASE_URL}" -v ON_ERROR_STOP=1 -f "${migration}"
done
echo "Migrations applied successfully"