Documentation
Everything about Badger SQL Migrate, from the first change to production pipelines.
Badger SQL Migrate deploys hand-written SQL changes to SQL Server, Azure SQL and PostgreSQL, in an order you control, and proves afterwards that every database received exactly what you intended. It is a single command-line tool, bsm, for Windows, macOS and Linux.
Five ideas
- Changes have names. A change is a folder (
changes/add-customer-email/) with adeploy.sql, arevert.sqland an optionalverify.sql. No version numbers to collide. - The plan decides the order.
bsm.planlists changes one per line. Git merges it without conflicts. The plan - Everything is hashed. Each change has a SHA-256 hash, and each position in the plan a chain hash over everything before it. Identical head hash, identical history. Hash certification
- Down is real. The database stores the revert script at deploy time and uses it to roll back. Revert
- Environments hold the differences. Servers, identities, variables and encryption keys differ per environment; change scripts do not. Environments
Where to start
- New project: Install, then the Quick start.
- Database already in production: Existing databases.
- Setting up a pipeline: CI/CD and Authentication.
- Looking for a script pattern: Examples.
Supported databases
SQL Server 2016 SP1 and later (on Windows, Linux and containers), Azure SQL Database and Azure SQL Managed Instance. The engine is vendor-neutral, so other databases can be added as providers (Library and providers); SQL Server is the only provider today.