CI for Schema Changes (GitHub Actions)
Run migrations, dbt build and SQLFluff lint inside GitHub Actions on every PR, with ephemeral databases.
Why CI for SQL?
Manual migrations cause outages. CI catches:
- Migration that fails to apply
- Migration that breaks existing tests
- Schema drift between environments
- Lint and test regressions
A Solid SQL CI Pipeline
- Spin up ephemeral Postgres (Docker / GitHub Actions service)
- Apply all migrations from scratch
- Apply only the new migrations on a copy of staging schema
- Run dbt build / Flyway test / app tests
- SQLFluff lint
- Schema diff report
All lessons in this course
- DBT (Data Build Tool) Fundamentals
- SQLFluff and Linting
- Testing SQL: dbt tests, Great Expectations
- CI for Schema Changes (GitHub Actions)