🗄️ db-migrate-cli
Database Schema Migration Runner with Drift Detection
A Python CLI tool that manages database migrations, detects schema drift between expected and actual states, and audits migration quality with 10 rules.
Features
| Command | What It Does |
|---|---|
db-migrate-cli status |
Show migration file status and history |
db-migrate-cli drift |
Detect schema drift between expected and actual |
db-migrate-cli audit |
Audit migration files for quality (10 rules) |
db-migrate-cli demo |
Run full demo with sample data |
db-migrate-cli rules |
List all migration quality rules |
Installation
git clone https://github.com/sanjaysundarmurthy/db-migrate-cli.git
cd db-migrate-cli
pip install -e .
Quick Start
db-migrate-cli demo -v
db-migrate-cli drift expected-schema.yaml actual-schema.yaml -v
db-migrate-cli audit ./migrations -v
db-migrate-cli status ./migrations
Drift Detection
Compares expected schema (from YAML/migrations) against actual database state:
- Missing/extra tables, columns, indexes
- Type mismatches, nullable differences, default value changes
- Severity scoring: CRITICAL → LOW with grade A+ to F
Migration Quality Rules (10)
| Rule | Severity | Description |
|---|---|---|
| MIG-001 | CRITICAL | Migration missing DOWN section |
| MIG-002 | HIGH | DROP TABLE without IF EXISTS |
| MIG-003 | HIGH | Destructive column drop |
| MIG-004 | MEDIUM | No transaction wrapping |
| MIG-005 | MEDIUM | Data manipulation in schema migration |
| MIG-006 | LOW | Migration file exceeds 100 lines |
| MIG-007 | HIGH | CREATE TABLE without primary key |
| MIG-008 | MEDIUM | Non-sequential migration version |
| MIG-009 | LOW | Name contains special characters |
| MIG-010 | INFO | CREATE INDEX without CONCURRENTLY |
Export Formats
Terminal (Rich), JSON, HTML
License
MIT
Metadata
Release files for db-migrate-cli 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| db_migrate_cli-1.0.0.tar.gz | 17.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| db_migrate_cli-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.8 kB
Release files / db_migrate_cli-1.0.0.tar.gz
| Download URL | db_migrate_cli-1.0.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75091e7cc8a2a3bd34327927b1ba6e8d5be60ccf315d8a72e99dc43ff4817150
|
|
BLAKE2b-256 checksum How to use checksums |
3013ab8ec5aa4235cc079b4eaa9e3ea3a2a26f048e5d943adfaaee4440a2f552
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Release files / db_migrate_cli-1.0.0-py3-none-any.whl
| Download URL | db_migrate_cli-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ccb21b1f3e3be587be879e0f4e3201443d9bf52ae40b885ec44ab1da5c37b1e
|
|
BLAKE2b-256 checksum How to use checksums |
ff19fd3ace9906e3ca1ac163c5888fa097b93c79a49e0570b324bfac487face5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Security for db-migrate-cli 1.0.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.