database-design

Designs database schemas with normalization, indexing, migrations, and ORM selection guidance.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/JenilRevaliya/ARGUS --skill database-design-jenilrevaliya
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/JenilRevaliya/ARGUS/tree/main/.agent/skills/database-design
Command: npx skills add https://github.com/JenilRevaliya/ARGUS --skill database-design-jenilrevaliya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Designing production database schemas involves many subtle pitfalls — wrong timestamp types, missing foreign key indexes, locking migrations, and connection exhaustion in serverless environments. This Skill provides concrete patterns and anti-patterns for schema design, migrations, indexing, and ORM selection so you avoid costly mistakes. ## Core Features & Use Cases - Schema Design Patterns: Standard table templates with TIMESTAMPTZ, identity columns, soft deletes, audit trails, and multi-tenancy via row-level security. - Migration & Indexing Guidance: Zero-downtime migration strategies, composite index column ordering, and index type selection (B-tree, GIN, HNSW, BRIN). - ORM & Database Selection: Decision tables for Drizzle, Prisma, Kysely, SQLAlchemy, and databases from PostgreSQL to pgvector. - Use Case: When building a new multi-tenant SaaS app, use this Skill to generate a schema with RLS tenant isolation, proper FK indexes, and a safe migration plan. ## Quick Start Ask the AI to design a PostgreSQL schema for your application with proper indexes, soft deletes, and a zero-downtime migration plan.

Frequently Asked Questions about database-design

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

FAQPage Schema
How do I design a PostgreSQL schema with soft deletes?▼

Add a nullable deleted_at TIMESTAMPTZ column and create a partial index with WHERE deleted_at IS NULL so active-row queries stay fast. Every query must filter on deleted_at, or you can expose a view that hides soft-deleted rows.

Prisma vs Drizzle: which ORM should I use?▼

Drizzle is SQL-like, lightweight, and edge-compatible, making it better for serverless and bundle-size-sensitive TypeScript projects. Prisma offers better developer experience and schema management but is heavy and not edge-compatible.

How do I add a column to a large table without downtime?▼

Add the column as nullable first, which takes no table lock. Backfill values in batches, deploy code that writes the column, then add the NOT NULL constraint in a later migration.

Does PostgreSQL automatically index foreign keys?▼

No, PostgreSQL does not auto-index foreign key columns. Without an index, cascading deletes and joins cause full table scans, so always create an index on each FK column manually.

Why does my serverless app hit max_connections on Postgres?▼

Each serverless function invocation opens a new database connection, quickly exhausting the limit. Use a connection pooler such as PgBouncer or Supabase Supavisor to reuse a small pool of connections.

Should I use UUID v4 as a primary key?▼

UUID v4 is random and fragments B-tree indexes on high-insert tables. Prefer UUID v7, which is time-ordered, or BIGINT GENERATED ALWAYS AS IDENTITY for better index performance.