Skip to main content

migsentry

Scan database migration SQL for the operations that lock tables, rewrite data or break the running app — before they hit prod.

$ migsentry scan migrations/versions/
== migrations/versions/0007_rename.sql: 3 checked, 0 skipped
  [DANGER] L1    rename-column on name
          ALTER TABLE users RENAME COLUMN name TO full_name;
          why: A rename moves the schema and code in one step only if they deploy together — they never do.
          fix: Expand/contract: add the new column, dual-write, backfill, move readers, then drop the old name.
  -> 3 finding(s): 2 danger, 1 info

Works on any source of migration SQL: Alembic autogenerate, Django sqlmigrate output, Prisma, handwritten. Exit code 1 on any danger finding — CI-gateable. Per-statement opt-outs with a directive, never silent file-level skips:

-- migsentry: no-check
DROP TABLE tmp_scratch;

What it flags (the classic expand/contract canon, aligned with strong_migrations/squawk checklists):

Class Severity Headline
drop-table / drop-column / truncate / rename-column / alter-type / not-null-existing danger unrecoverable, breaks live readers, or full-table rewrite under ACCESS EXCLUSIVE
plain CREATE INDEX / direct FOREIGN KEY / ADD COLUMN with DEFAULT / LOCK TABLE warn locking pitfalls with a known two-step or CONCURRENTLY fix
any CREATE INDEX info even CONCURRENTLY scans everything — budget time on big tables

Each finding prints why (engine-specific locking semantics) and fix (the expand/contract alternative). Python 3.11+, stdlib only.

migsentry scan <file-or-dir>... [--json]

Install: pip install migsentry — or from this repo: pip install "git+https://github.com/juzorei/migsentry#subdirectory=tools/migsentry"

The companion agent skill lives in skills/migration-safety-review. Skills: npx skills add juzorei/migsentry.

Metadata

Release files for migsentry 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for migsentry 0.1.0
File Size Uploaded Provenance Actions
migsentry-0.1.0.tar.gz 7.5 kB With provenance Details for migsentry-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for migsentry 0.1.0
File Interpreter ABI Platform Actions
migsentry-0.1.0-py3-none-any.whl Python 3 none any Details for migsentry-0.1.0-py3-none-any.whl

Total release size: 14.9 kB

Release files / migsentry-0.1.0.tar.gz

Download URL migsentry-0.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2723c2557bb1f1f8fdbd166653279a59b491a735b5ae1ae4fd03d3d54ed5a395
BLAKE2b-256 checksum
How to use checksums
340dd1a5ecdf65e8a7148fce6ee97aadd8849e88bdbba701149c522470892670
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / migsentry-0.1.0-py3-none-any.whl

Download URL migsentry-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b20ff09c719d0f888a8dfe4e63e19125e6a003fae174b0a323581ef6bc51f53b
BLAKE2b-256 checksum
How to use checksums
efd8086e5f0f0efa5e954ffd8b0c6cf61ca93f02c9e126d27a1edd0d784b5a0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for migsentry 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for migsentry-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page