Coding

Database schema design assistant

Describe a feature in plain language along with your database engine, expected scale, and existing tables to get a second opinion before writing migrations that are painful to undo. Returns proposed tables, keys, and indexes with the reasoning behind each normalization or denormalization decision, flags which constraints belong at the database level instead of application code, and stress-tests the design against one likely future change.

Prompt
Design a database schema for the following feature.

Feature description:
{{description}}

Database engine:
{{db_engine}}

Expected scale:
{{row_counts}}

Existing related tables (if any):
{{schema}}

Provide:
1. Proposed tables with columns, types, and primary/foreign keys.
2. Normalization decisions, and any deliberate denormalization with the reason for it.
3. Indexes needed for the described query patterns, and why each one earns its cost.
4. Constraints (uniqueness, not-null, checks) that should be enforced at the database level rather than in application code.
5. One likely future change to the feature, and how well this schema would absorb it.
Download .md

Variables