Back to skills
SKILL.md
Database Migration Patterns
ASecuritySafe schema migrations alembic rollback zero downtime
- 2 stars
- 0 votes
- 0 copies
- 2 views
- Added September 10, 2026
Security analysis
96/100- Installs packages at runtime which could introduce malicious dependencies
npx -y skills add LoopyLuci/Skills --skill database-migration-patterns --agent claude-codeAre you the author of Database Migration Patterns?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/loopyluci-database-migration-patterns)---
name: database-migration-patterns
description: "Safe schema migrations alembic rollback zero downtime"
---
# Database Migration Patterns
## Alembic
```bash
pip install alembic
alembic init migrations
alembic revision --autogenerate -m "add users table"
alembic upgrade head
```
## Rollback
```bash
alembic downgrade -1
```
## Zero-Downtime Steps
1. Add column nullable
2. Deploy app (writes to new column)
3. Backfill data
4. Add NOT NULL constraint
5. Deploy app (reads from new column)
6. Drop old column
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.