database-design

Design database schemas and migration strategies for multi-tenant SaaS applications.

3|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/The13thNode/VibeCorp_PromptCEO --skill database-design-the13thnode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/The13thNode/VibeCorp_PromptCEO/tree/main/skills/public/database-design
Command: npx skills add https://github.com/The13thNode/VibeCorp_PromptCEO --skill database-design-the13thnode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing a reliable data model and migration strategy is hard; poor schema decisions lead to costly rewrites, performance bottlenecks, and data loss. This skill gives teams a proven framework for building secure, maintainable databases with auditability and multi‑tenant support.

Core Features & Use Cases

  • Schema Foundations: UUID primary keys, audit columns, soft‑delete, and foreign‑key constraints built into every table.
  • Multi‑Tenancy Patterns: Guidance for shared‑schema RLS, separate schemas, or isolated databases.
  • Migration Safety: Zero‑downtime migration recipes, column‑addition and renaming workflows.
  • ORM Guidance: Prisma and Drizzle schema examples plus query‑optimization best practices.
  • Use Case Example: A SaaS startup can instantly define users, organizations, and audit tables, then apply safe migrations as the product evolves.

Quick Start

Ask the database‑design skill to create a PostgreSQL schema for a multi‑tenant SaaS with users, organizations, and audit logs.

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 for a multi-tenant SaaS application?

Designing a PostgreSQL schema for multi-tenant SaaS involves implementing UUID primary keys, audit columns, and foreign-key constraints. You can apply shared-schema Row Level Security (RLS), separate schemas, or isolated databases to ensure data isolation and compliance.

What is the best way to perform zero-downtime database migrations?

The best way to perform zero-downtime database migrations is using structured recipes for column additions and renaming workflows. This approach prevents lock contention and data loss, ensuring continuous application availability while evolving your schema safely.

How do I set up soft deletes and audit logging in a relational database?

To set up soft deletes and audit logging in a relational database, integrate dedicated audit columns and soft-delete flags into every table. This framework maintains historical records and supports compliance without permanently erasing data.

Can I use this database schema design approach with Prisma or Drizzle ORM?

Yes, this database schema design approach works with Prisma and Drizzle ORM. It provides specific schema examples and query-optimization best practices to ensure your ORM mappings align with UUID keys, constraints, and indexing strategies.

When do I need separate schemas versus shared-schema RLS for multi-tenancy?

You need separate schemas or isolated databases for multi-tenancy when strict data isolation is required, whereas shared-schema RLS is suitable for cost-effective tenant separation within a single PostgreSQL database instance.

Why use UUID primary keys instead of sequential integers for scalable apps?

Using UUID primary keys instead of sequential integers for scalable apps prevents enumeration attacks and eliminates database contention during concurrent inserts. This approach is essential for distributed systems and secure, maintainable data models.