Lone Badger Tech

Teams and ordering

Concurrent development without version collisions, and deploys that cannot interleave.

Two developers, same day

Alice adds add-customer-email and Bob adds add-order-index on separate branches. Each appends a line to bsm.plan. With version numbers they would both have picked V12; with names there is nothing to collide on, and git's union merge keeps both lines. bsm plan check in CI verifies the merged plan.

Shared databases and out-of-order changes

Bob's change reached the shared dev database first. After the merge, Alice's line sits above Bob's in the plan, but Bob's change is already deployed. What happens next is the environment's ordering:

orderingBehaviourUse for
dependency (default)Deploy Alice's change now (its dependencies are satisfied), flagged out of order. The database is up to date but not certified.Shared dev and test databases
strictRefuse. The database must receive changes in exact plan order.Production

Production databases only ever see the merged plan, in order, so they certify. Bring a dev database back to plan order with bsm rebase --to <last common change>. Override per run with --ordering strict|dependency.

Concurrent deploys

Deploy, revert, baseline and provisioning hold an exclusive lock on the database for the whole run (sp_getapplock, session-owned, works on Azure SQL). A second pipeline waits up to lockTimeoutSeconds (default 300) and then fails with a message naming the lock. Read-only commands (status, verify, log) do not take the lock.

Recommended workflow

  1. Each developer works against their own database (local environment).
  2. bsm plan check runs on every pull request.
  3. Merges deploy to a shared test environment (ordering: dependency).
  4. Releases deploy to production (ordering: strict, protected: true, allowRevert: false) and run bsm verify.