07. Design data model
Choose primary/foreign keys, nullability, uniqueness, indexes, retention, and amounts.
What it is
Choose primary/foreign keys, nullability, uniqueness, indexes, retention, and amounts.
When to use it
Workflow step 7 of 17. Apply before moving to the next decision.
Syntax
7. Design data model
Choose primary/foreign keys, nullability, uniqueness, indexes, retention, and amounts.Example
accounts: id PK, user_id FK, currency, balance_cents.
transactions: id PK, account_id FK, reference UNIQUE, state.
Index transactions(account_id, id).Common mistakes
Skipping this decision makes later implementation depend on unstated assumptions.