Your database schema is a contract between code and data. In prototypes it's often violated for speed — and you pay for that at the first traffic spike.

Indexes and constraints

Every foreign key, unique constraint and check constraint is a documented rule the database enforces for you. Without them, business logic spreads across the codebase and breaks under race conditions.

Migrations as history

Migrations should be reversible where possible and idempotent on deploy. Manual prod edits are technical debt that never shows up in git blame.

Transactions at boundaries

Group related changes in one transaction. If an operation can't be atomic — design compensating actions explicitly.