Design Production-Ready Database Schemas with Migrations
Generates complete database schemas with tables, relationships, indexes, migration scripts, and performance optimizations tailored to your application's data patterns.
When to use this prompt
Use this when you need to design a database structure from scratch for a new application or feature. It's particularly valuable when you need to consider query patterns, data volume, and performance requirements upfront rather than retrofitting later.
You are a database architect who designs efficient schemas. Design a database schema for [APPLICATION/FEATURE]. Requirements: - Use case: [USE CASE] - Expected data volume: [VOLUME] - Query patterns: [PATTERNS] - Database type: [SQL/NOSQL] Provide: 1. Schema design - Tables/collections - Fields with types - Relationships - Indexes 2. Normalization analysis - Current normal form - Denormalization decisions 3. Sample queries - Common operations - Complex queries - Optimization notes 4. Migration scripts - Schema creation - Initial data - Version control approach 5. Performance considerations - Index strategy - Partitioning needs - Caching opportunities Include ER diagram description and SQL/schema code.
Free to use — the optimizer tailors this template to your exact task and target AI.
How to customize it
- [APPLICATION/FEATURE] — Specify what you're building, such as 'e-commerce order management system' or 'multi-tenant SaaS analytics dashboard'
- [USE CASE] — Describe how the data will be used, including read/write patterns and user interactions with the system
- [VOLUME] — State expected data scale, such as '10K users, 100K transactions/month' or '1M records growing 20% annually'
- [PATTERNS] — List the types of queries you'll run most often, like 'user lookup by email, order history by date range, product search with filters'
What you'll get back
The AI returns a complete schema design including table/collection definitions with field types, relationships between entities, index recommendations, normalization analysis explaining design choices, sample SQL or query code for common operations, migration scripts for creating the schema, and a text description of an entity-relationship diagram showing how tables connect.
Related prompts
Code Refactoring Guide
Guides AI to analyze and refactor code using clean code principles, returning improved code with detailed explanations of each change.
Code Reviewer
Instructs AI to perform a comprehensive code review covering bugs, security, performance, style, and best practices with severity ratings and corrections.
Database Query Optimizer
Analyzes slow database queries and returns optimized versions with index recommendations, execution plan analysis, and performance tradeoffs.
Entity-Relationship Schema Builder for Any Database
Generates a complete database schema with ER diagrams, table definitions, indexes, normalization analysis, and migration strategy for your application.
Error Handling Framework
Generates a complete error handling strategy for your application, including classification systems, handling patterns, logging, user messages, and monitoring setup with code examples.
Error Handling Strategy
Generates a comprehensive error handling strategy for your application, including classification systems, handling patterns, logging approaches, and code examples.
Make this prompt yours
PromptWizz rewrites this template around your specific task, audience, and target AI — and shows you why each change works.
Try the Optimizer Free