laneweaver-database-design

Design PostgreSQL 17 schemas with Supabase conventions for laneweaverTMS.

4|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill laneweaver-database-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laneweaver-database-design
Source: https://github.com/linehaul-ai/linehaulai-claude-marketplace/tree/main/.claude-plugin/supabase/skills/laneweaver-database-design
Command: npx skills add https://github.com/linehaul-ai/linehaulai-claude-marketplace --skill laneweaver-database-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps design PostgreSQL 17 schemas for laneweaverTMS using Supabase conventions—UUIDs, ENUMs, audit trails, soft deletes, triggers, functions, views, and atomic migration patterns—reducing manual design time and ensuring consistency across deployments.

Core Features & Use Cases

  • Schema design: Define UUID primary keys, audit columns, soft deletes, and row-level security policies.
  • Enum strategy: Plan and deploy 32+ ENUMs to represent lifecycle, statuses, and categories.
  • Migrations & Automation: Create deterministic, atomic migrations with triggers and functions.
  • Polymorphic relationships & views: Model complex relationships and derived data for reporting.

Quick Start

Provide a deterministic migration plan for laneweaverTMS using Supabase conventions. For example, create an initial schema for the loads table with UUID primary key, audit columns, and soft delete, and set up a trigger to populate updated_at on modifications.

Frequently Asked Questions about laneweaver-database-design

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

FAQPage Schema
How do I design a PostgreSQL schema with UUID primary keys and audit trails?

Design PostgreSQL schemas with UUID primary keys, standard audit columns (created_at, updated_at, created_by, updated_by, deleted_at, deleted_by), and soft delete patterns. Use triggers to automate audit column population and ensure data consistency across all tables in your Supabase deployment.

What's the best way to implement row-level security policies in PostgreSQL?

Row-level security (RLS) policies restrict table access at the row level based on user context. Define policies in PostgreSQL to enforce tenant isolation, role-based access, and data privacy. Supabase conventions integrate RLS with UUID-based ownership and audit columns for secure multi-tenant architectures.

How do I create safe database migrations for PostgreSQL with Supabase?

Create deterministic, atomic migrations using PostgreSQL functions and triggers to ensure consistency. Follow Supabase conventions: use UUID identifiers, define audit columns upfront, implement soft deletes, and version migrations as code. This prevents manual errors and ensures safe deployments across environments.

Can I use ENUMs in PostgreSQL for status and lifecycle fields?

ENUMs represent fixed categories like statuses and lifecycle states efficiently in PostgreSQL. Plan and deploy ENUMs carefully to avoid migration complexity. Define them once, use them consistently across tables, and handle schema evolution with caution when adding or removing enum values.

How do I model polymorphic relationships and create calculated views in PostgreSQL?

Model polymorphic relationships using UUID foreign keys and type discriminator columns. Create views to flatten complex relationships and compute derived data for reporting. Combine with indexes and constraints to maintain query performance and data integrity.

What constraints and data types should I enforce in a production PostgreSQL schema?

Enforce NOT NULL, UNIQUE, and foreign key constraints at the schema level. Use appropriate data types (UUID, ENUM, TIMESTAMP, TEXT) and soft delete patterns to maintain data quality. Add indexes on foreign keys and frequently queried columns to optimize performance and ensure referential integrity.