Quick start
From an empty folder to a certified database in ten minutes.
You need a SQL Server you can reach. A local container works:
docker run -d --name sql -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD="Your_str0ng_password" -p 1433:1433 mcr.microsoft.com/mssql/server:2022-latest
export BSM_LOCAL_PASSWORD="Your_str0ng_password"
1. Create a project
bsm init -C db
cd db
This writes bsm.yaml, an empty bsm.plan, the changes/, repeatable/ and environments/ folders, and a .gitattributes rule that lets git merge the plan. Edit the local environment in bsm.yaml so database: names a database that exists.
2. Add a change
bsm add create-customer
changes/create-customer/deploy.sqlCREATE TABLE dbo.Customer (
Id int IDENTITY NOT NULL CONSTRAINT PK_Customer PRIMARY KEY,
Name nvarchar(200) NOT NULL
);
changes/create-customer/revert.sqlDROP TABLE dbo.Customer;
changes/create-customer/verify.sqlIF OBJECT_ID(N'dbo.Customer', N'U') IS NULL THROW 50000, N'Customer missing', 1;
3. Check, then deploy
bsm plan check # no database needed: plan, folders, lint, variables
bsm doctor # can we sign in and connect?
bsm deploy --dry-run
bsm deploy
4. Look at the result
bsm status
environment local
target sqlserver://localhost:1433/App
+ create-customer 2026-11-03 18:03Z you
database head 0e21ef9c72f3
plan head 0e21ef9c72f3
up to date and certified: database history is identical to the plan.
5. Change your mind
bsm add add-customer-email --requires create-customer
# write deploy.sql / revert.sql
bsm deploy
bsm revert --last 1 # runs the revert.sql stored at deploy time
bsm deploy # and forward again
bsm log # who did what, when, from where
Next
- Add a test and a production environment: Environments.
- Sign in with Entra ID: Authentication.
- Commit
db/to git and addbsm plan checkto CI: CI/CD.