database-patterns

Solid

Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.

API & Backend 180 stars 15 forks Updated today MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
75
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

<!-- directive-density: intentional (teaches migration anti-patterns; NEVER markers describe real production-break conditions, not aspirational guidance) --> # Database Patterns Comprehensive patterns for database migrations, schema design, and version management. Each category has individual rule files in `rules/` loaded on-demand. ## Quick Reference | Category | Rules | Impact | When to Use | |----------|-------|--------|-------------| | [Alembic Migrations](#alembic-migrations) | 3 | CRITICAL | Autogenerate, data migrations, branch management | | [Schema Design](#schema-design) | 3 | HIGH | Normalization, indexing strategies, NoSQL patterns | | [Versioning](#versioning) | 3 | HIGH | Changelogs, rollback plans, schema drift detection | | [Zero-Downtime Migration](#zero-downtime-migration) | 2 | CRITICAL | Expand-contract, pgroll, rollback monitoring | | [Database Selection](#database-selection) | 1 | HIGH | Choosing the right database, PostgreSQL vs MongoDB, cost analysis | **Total: 12 rules across 5 categories** ## Quick Start ```python # Alembic: Auto-generate migration from model changes # alembic revision --autogenerate -m "add user preferences" def upgrade() -> None: op.add_column('users', sa.Column('org_id', UUID(as_uuid=True), nullable=True)) op.execute("UPDATE users SET org_id = 'default-org-uuid' WHERE org_id IS NULL") def downgrade() -> None: op.drop_column('users', 'org_id') ``` ```sql -- Schema: Normalization to 3NF with proper indexing CR...

Details

Author
yonatangross
Repository
yonatangross/orchestkit
Created
5 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category