What problem does it solve?
This Skill helps you design, implement, and optimize database schemas for Laravel applications, ensuring data integrity, performance, and maintainability.
Core Features & Use Cases
- Migration Best Practices: Learn how to create clear, maintainable, and safe database migrations.
- Column Types & Modifiers: Understand the full range of available column types and their modifiers for precise data representation.
- Indexing Strategies: Implement effective indexing to speed up queries and improve application performance.
- Eloquent Relationships: Define and utilize all types of Eloquent relationships (one-to-one, one-to-many, many-to-many, polymorphic) correctly.
- Soft Deletes & Transactions: Implement safe data deletion and ensure data consistency with database transactions.
- Query Optimization: Learn techniques to prevent N+1 problems, use subqueries, and optimize common query patterns.
- Use Case: When creating a new
orders table, this Skill will guide you on defining columns like user_id (foreign key), status (enum), total (decimal), and setting up appropriate indexes and timestamps.
Quick Start
Use the database-design skill to create a migration for a new products table with name, price, and stock columns.