Home / Start here

Real-world scenarios

Seven situations teams meet every week. Each terminal below is produced by the real CLI on a small sample project when this site is built.

The projects are illustrative, not customer stories. The commands, rules and output are real.

#SituationWho caresResult
1A cleanup drops a column and a tableDeveloper, DBANO_GO
2A new required column on a busy tableDBA, SREREVIEW_REQUIRED with warnings
3A framework major upgradeDeveloperSafe rehearsal, REVIEW_REQUIRED
4Builds that change on their ownPlatform teamPinning findings
5Code changes after the scanReviewerPlan refused
6A pull request gateCI ownerExit code 1
7Proving the fix workedAuditorOne finding resolved

1. The Friday cleanup that drops a column#

Situation. A developer tidies the schema late in the week. One migration removes a column and a table. An old report job still reads both.

What to do. Do not drop in the same release that stops using the data. Follow expand-contract:

  1. 1. ExpandAdd the new column as nullable. Old code keeps working.
  2. 2. Dual writeThe application writes both old and new columns.
  3. 3. BackfillCopy history in small batches. Check the counts.
  4. 4. Switch readsRead the new column. Keep the old one for rollback.
  5. 5. ContractAfter a safe window and a tested restore, drop the old column.

Limit. The tool cannot know who still reads the column. Search your consumers before you contract.

2. A new required column on a busy table#

Situation. Product wants a mandatory region field. The migration adds it as NOT NULL, builds an index and renames a column in one step.

Why it matters. Adding a required column without a default fails on a table with rows. A plain index build can block writes on PostgreSQL. A rename breaks any server still running the old code.

Safer version.

ALTER TABLE customers ADD COLUMN region text;
-- backfill in batches, then add the constraint
CREATE INDEX CONCURRENTLY idx_region ON customers(region);

Limit. CREATE INDEX CONCURRENTLY is PostgreSQL syntax and cannot run inside a transaction. Check your engine.

3. Moving a web framework to a new major#

Situation. A team wants to move express from 4 to 5 and needs a reviewable first step.

What a static rehearsal really does

What to do. Read the vendor upgrade notes, apply the change on a branch, install in an isolated environment and run your tests. The report lists these as prerequisites.

Limit. The rehearsal proves the manifest edit only. It does not prove the application works.

4. Builds that change on their own#

Situation. The same commit builds differently on two days. Nothing in the code changed.

What to do. Pin the base image by digest, pin Python requirements with ==, replace latest with a real version and commit a lockfile.

5. Someone edits the code after the scan#

Situation. A reviewer approves a scan. Before the plan is created, a teammate changes package.json.

Why it matters. An approval should apply to the exact content that was reviewed. The hash mismatch stops the flow. Scan again.

6. Blocking a pull request in CI#

Situation. A pipeline must stop destructive migrations before merge.

MigraSutra in a pipeline
- run: npx migrasutra audit --root . --out migrasutra-report --fail high
- uses: actions/upload-artifact@v7
  if: always()
  with:
    name: migrasutra-report
    path: migrasutra-report

What to do when a finding is intended. There is no suppression file yet. Review the finding, record the approval in the pull request and run the step as advisory for that change.

7. Proving the fix worked#

Situation. An auditor asks for proof that the risky statement is gone.

Limit. The comparison tracks findings by file, line and rule. Moving a statement to another line shows it as resolved and introduced.