Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Relational Database Design

Designs PostgreSQL schemas so the database enforces your rules, with better keys, constraints and column types.

Claude's review

7/10 Sharp PostgreSQL schema rules that correct real wrong defaults, from NULL passing CHECKs to soft delete breaking constraints.

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Corrects the wrong defaults a model has when designing a relational schema — the DDL decisions an experienced engineer makes differently. Use when creating or reviewing tables, migrations, ER models, or ORM schema definitions. Covers identity and keys (surrogate vs natural, identity vs serial, uuidv7, composite keys that make cross-tenant references impossible), relationships (polymorphic foreign keys the database cannot enforce, referential actions, unindexed FK columns, disjoint subtypes), invariants the engine can prove instead of application code (EXCLUDE, partial unique indexes, CHECK limits, deferrable cycles, NOT VALID), types (timestamptz, exact money, range types, enum vs lookup table), derived and encoded data (generated columns, JSONB as an escape hatch), and time (events vs in-place updates, soft-delete flags that silently disable constraints, temporal keys). NOT for query tuning, index selection for read paths, or connection pooling.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: relational-data-modeling
description: Corrects the wrong defaults a model has when designing a relational schema — the DDL decisions an experienced engineer makes differently. Use when creating or reviewing tables, migrations, ER models, or ORM schema definitions. Covers identity and keys (surrogate vs natural, identity vs serial, uuidv7, composite keys that make cross-tenant references impossible), relationships (polymorphic foreign keys the database cannot enforce, referential actions, unindexed FK columns, disjoint subtypes), invariants the engine can prove instead of application code (EXCLUDE, partial unique indexes, CHECK limits, deferrable cycles, NOT VALID), types (timestamptz, exact money, range types, enum vs lookup table), derived and encoded data (generated columns, JSONB as an escape hatch), and time (events vs in-place updates, soft-delete flags that silently disable constraints, temporal keys). NOT for query tuning, index selection for read paths, or connection pooling.
---

# Relational Data Modeling

The decisions a relational schema forces, and how to settle them so the database
enforces what it can and the application is left with only what it must. Every
rule names the wrong default it corrects; there is no rule for what a capable
model already gets right.

**Examples are PostgreSQL 18**, and every DDL statement in this skill was
executed against 18.4 — including the failure cases, to confirm the constraints
reject what they claim to reject. Roughly a third of the rules depend on
mechanisms MySQL and SQLite do not have (`EXCLUDE`, partial unique indexes,
range types, `WITHOUT OVERLAPS`, deferrable constraints, `NOT VALID`); those
rules say so. The judgment rules transfer to any relational engine.

## When to Apply

Use this skill when:

- Writing or reviewing `CREATE TABLE` / `ALTER TABLE`, a migration, or an ORM
  schema definition (Prisma, Drizzle, Django models, ActiveRecord, Ecto, SQLAlchemy)
- Designing an entity-relationship model, or naming what a row *is* — the point
  where key choices become expensive to reverse
- The user says "should this be one table or two", "how do I model many-to-many",
  "the schema allows bad data", "we need history", "we're adding multi-tenancy",
  or "can the database enforce this"
- A bug turns out to be a schema that permitted the bad state — duplicates that
  a unique constraint should have caught, orphans a foreign key should have
  blocked, overlapping bookings, two rows flagged as default
- Adding constraints to a table that already has rows and traffic
- Reviewing a schema generated by an ORM or a scaffolding tool, which is where
  polymorphic associations, reflexive surrogate keys, and blanket soft-delete
  flags arrive from

This skill is NOT for:

...

From pproenca's repository, MIT licence.

Related skills

  • Checked

    HTTP API design review

    Designs or reviews HTTP endpoints, auth, pagination and versioning, so API changes do not break your clients.

    by AmazingAng 770
    7/101 credit
  • Checked

    Supabase auth and database

    Builds with Supabase auth, database, storage and edge functions while avoiding common security traps.

    by supabase 3.2k
    8/101 credit
  • Checked

    AWS schema conversion

    Runs AWS DMS Schema Conversion projects to move database schemas between engines and convert SQL to match.

    by aws 3.7k
    7/101 credit
  • Checked

    Reversible database migrations

    Writes safe, reversible migrations for Postgres, Prisma, Django and others, so tables change without downtime.

    by affaan-m 314k
    8/101 credit
  • Checked

    Firebase Done Right

    Builds Firebase apps with safe security rules, data models that scale and reliable Cloud Functions.

    by ericrisco 691
    7/101 credit
  • Checked

    Google Workspace API Setup

    Connects your server code to Gmail, Drive, Calendar and Sheets with safe service accounts and fewer quota errors.

    by ericrisco 691
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added