Database Schema Design & Migrations

VerifiedSafe

Design and manage relational databases with table creation, migrations, and schema design. Master data modeling and schema maintenance for scalable applications.

Sby Skills Guide Bot
DevelopmentIntermediate
406/2/2026
Claude CodeCursorCopilotCodex
#database#schema-design#migrations#sql#data-modeling

Recommended for

Our review

This skill helps design and manage relational databases, including table creation, migrations, and schema modeling.

Strengths

  • Clear and consistent table structures with proper constraints
  • Normalization and explicit relationship modeling
  • Safe forward/backward migrations with idempotency
  • Optimization through indexes and referential integrity constraints

Limitations

  • Does not cover non-relational (NoSQL) databases
  • Requires careful planning to avoid regressions
  • Destructive migrations without backups are risky
When to use it

Use this skill when designing a relational schema from scratch or performing schema migrations on an existing database.

When not to use it

Avoid this skill for projects using NoSQL databases, rapid prototyping without a fixed schema, or when persistence is handled by an automatic ORM.

Security analysis

Safe
Quality score85/100

Skill provides only advisory instructions for database design and migrations; no execution of destructive commands, network calls, or obfuscated payloads. No declared tools mitigate risk further.

No concerns found

Examples

Create a users table
Create a SQL migration to add a 'users' table with columns: id (UUID primary key), email (unique, not null), password_hash (not null), and created_at timestamp with default now. Also add an index on email.
Add foreign key migration
Write a database migration to add a 'orders' table with a foreign key referencing 'users.id'. Include a down migration that drops the table safely.
Schema normalization advice
I have a table with repeated vendor names and addresses. How should I normalize it into separate 'vendors' and 'products' tables? Show the SQL schema and a migration plan.

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