database-patterns

Design database schemas and migrations with naming, typing, and indexing conventions.

5|3|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/zebbern/termstack --skill database-patterns-zebbern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-patterns
Source: https://github.com/zebbern/termstack/tree/main/.github/skills/database-patterns
Command: npx skills add https://github.com/zebbern/termstack --skill database-patterns-zebbern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This reference provides established patterns for schema design, efficient migrations, and optimized querying to help teams build robust, scalable databases.

Core Features & Use Cases

  • Schema Design Principles: Naming conventions for tables and columns, standard primary keys, and clear timestamps and soft-delete fields; data-type guidance to prevent over/under-sizing; enforce foreign keys and explicit relationships.
  • Migration Conventions: File naming with timestamps, a reversible structure, and one logical change per file to support safe deployments.
  • Indexing Strategies & Query Optimization: When to index, which index types to use, and practical tips to avoid common anti-patterns.

Quick Start

Apply these patterns to your current schema by aligning table and column naming, choosing appropriate data types, and adding the recommended indexes.

Frequently Asked Questions about database-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the best practices for database schema design and naming conventions?

Database schema design best practices include using explicit naming conventions for tables and columns, selecting appropriate data types to prevent over-sizing, enforcing foreign-key constraints, and adding standard primary keys with clear timestamps.

How do I create reversible database migrations for safe deployments?

Create reversible database migrations by using timestamped file naming, structuring each file with one logical change, and ensuring every migration includes both forward and reverse operations to support safe deployments.

When should I add indexes to a database table for query optimization?

Add database indexes when query performance demands it, selecting appropriate index types based on access patterns, while avoiding common indexing anti-patterns that degrade write performance or bloat storage.

How do I choose the right data types to prevent database schema over-sizing?

Choose database data types by following explicit data-type guidance that matches your value ranges, preventing both over-sizing and under-sizing while maintaining schema integrity and query efficiency.

Does this database design approach work for all relational databases?

Yes, these database schema design and migration patterns apply across relational databases, covering naming conventions, typing, foreign-key constraints, indexing strategies, and query optimization universally.