database

Designs PostgreSQL database schemas with Laravel migration-ready guidance and business rules.

1|Updated Jun 29, 2026
One-click install
npx skills add https://github.com/natthasath/natthasath-marketplace --skill database-natthasath
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/natthasath/natthasath-marketplace/tree/main/plugins/masterplan/skills/database
Command: npx skills add https://github.com/natthasath/natthasath-marketplace --skill database-natthasath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a database schema from scratch is error-prone: unclear entity boundaries, missing constraints, and poorly planned relationships lead to data inconsistency and costly rework. This Skill turns a System Requirement Masterplan into a complete, migration-ready database design for PostgreSQL and Laravel. ## Core Features & Use Cases - Entity & Relationship Design: Identifies core entities, defines One-to-One, One-to-Many, Many-to-Many, and Polymorphic relationships, and specifies pivot tables and foreign keys. - Business Rules & Constraints: Embeds business logic at the database layer (uniqueness, delete protection, audit logs) so data stays consistent even if the application layer fails. - Laravel Migration Guidance: Provides table creation order, FK/index/pivot naming conventions, and Seeder/Factory suggestions, delivered as a database-design.md document. - Use Case: After finishing architecture planning with /architect, run /database to produce a full schema for an e-commerce system — tables, relationships, constraints, and migration suggestions — ready for developers to implement immediately. ## Quick Start Invoke the /database command with the system you want to design, for example "/database ระบบจองห้องประชุม", and attach your requirement masterplan if available.

Frequently Asked Questions about database

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

FAQPage Schema
How do I design a database schema for a Laravel project?▼

Start from your system requirements to identify entities and relationships, then define tables with PostgreSQL column types, constraints, and foreign keys. This Skill guides that process and outputs a database-design.md with migration ordering and naming conventions.

How to plan Laravel migrations from an ER design?▼

Define entities and relationship types first (One-to-Many, Many-to-Many, Polymorphic), then map them to migrations using foreignId, morphs, timestamps, and softDeletes. Create tables in dependency order so foreign keys reference existing tables.

Does this Skill work with databases other than PostgreSQL?▼

The Skill is specialized for PostgreSQL column types and Laravel Eloquent conventions. The logical design steps (entities, relationships, constraints) transfer to other databases, but migration guidance targets Laravel specifically.

When should I use Many-to-Many with a pivot table in Laravel?▼

Use a pivot table when two entities have a bidirectional many-to-many relationship, such as users and roles. The Skill identifies these cases from your requirements and recommends pivot table naming and structure.

What inputs does the database design Skill need?▼

It works best with a System Requirement Masterplan or Use Case Diagram attached, typically produced earlier in the workflow by /requirement and /architect. It is invoked manually via /database and does not auto-trigger from conversation.