Database Schema Design & Migrations

VerifiedSafe

Design and manage relational database schemas including table creation, migrations, and schema design. Helps create consistent table structures with proper keys and constraints. Manages schema changes through forward and backward migrations. Suitable for database modeling and maintenance tasks.

Sby Skills Guide Bot
DevelopmentIntermediate
506/2/2026
Claude CodeCursorWindsurfCopilotCodex
#database#schema-design#migrations#sql#relational-database

Recommended for

Our review

This skill enables designing and managing relational databases, including table creation, migrations, and schema modeling.

Strengths

  • Explicit normalization and relationship modeling
  • Safe and reversible migrations
  • Support for indexes and constraints for performance and integrity

Limitations

  • Does not cover NoSQL databases
  • May not handle advanced partitioning or sharding scenarios
  • No specific DBMS-specific recommendations
When to use it

Use this skill when designing a new relational schema, applying migrations, or reviewing an existing database structure.

When not to use it

Avoid this skill for non-relational databases or if you need advice on query optimization or advanced administration.

Security analysis

Safe
Quality score88/100

The skill provides purely instructional guidance on database design and migrations. It does not involve executing any commands, accessing external resources, or performing potentially harmful operations. No tools are declared, and the content is void of destructive or exfiltration instructions.

No concerns found

Examples

Create users table
Create a SQL table for users with columns: id (UUID primary key), email (unique, not null), password_hash (not null), and created_at (default now).
Add migration for new column
Write a migration to add a 'status' column (VARCHAR, default 'active') to the 'orders' table, with a forward and backward migration.
Design schema for e-commerce
Design a relational schema for a simple e-commerce system with products, customers, orders, and line items. Include primary keys, foreign keys, and indexes.

name: database-skill description: Design and manage relational databases including table creation, migrations, and schema design. Use for database modeling and maintenance.

Database Skill – Schema Design & Migrations

Instructions

  1. Table Creation

    • Define clear and consistent table structures
    • Use appropriate data types and constraints
    • Apply primary keys and foreign keys correctly
  2. Schema Design

    • Normalize data where appropriate
    • Model relationships explicitly
    • Design for scalability and maintainability
  3. Migrations

    • Create forward and backward migrations
    • Ensure migrations are idempotent and safe
    • Avoid destructive changes without backups
  4. Indexes & Constraints

    • Add indexes for frequently queried columns
    • Enforce uniqueness and referential integrity
    • Use constraints to protect data correctness

Best Practices

  • Use consistent naming conventions
  • Keep schemas simple and well-documented
  • Version control all migrations
  • Test migrations in non-production environments
  • Follow relational database design principles

Example Structure

CREATE TABLE users (
  id UUID PRIMARY KEY,
  email TEXT UNIQUE NOT NULL,
  password_hash TEXT NOT NULL,
  created_at TIMESTAMP DEFAULT NOW()
);
Related skills