Database Column Name Patterns
The standard pattern for every column category — with examples you can copy straight into a migration.
| Category | Pattern | Examples | Notes |
|---|---|---|---|
| Primary key | id or <table>_id | id, user_id | Pick one style per schema. <table>_id removes ambiguity in joins. |
| Foreign key | <referenced_table>_id | order_id, customer_id | Match the referenced primary key name exactly. |
| Boolean | is_<adjective>, has_<noun>, can_<verb> | is_active, has_avatar, can_edit | Reads as a yes/no question. Never a bare adjective. |
| Timestamp | <event>_at | created_at, deleted_at, last_login_at | _at for instants; _date for calendar dates. |
| Soft delete | deleted_at | deleted_at | NULL means active — the standard soft-delete convention. |
| Audit | created_by, updated_by | created_by | Stores a user or system identifier. |
| Name / title | name, title, slug | display_name, product_slug | Singular; qualify only when ambiguous. |
| Contact | <channel> or <channel>_address | email, email_address, phone_number | email alone is fine; email_address when the table also has email preferences. |
| Amount | <what>_amount, <what>_price | total_amount, unit_price | State what is measured; include currency handling elsewhere. |
| Count | <thing>_count | view_count, stock_count | Prefer over bare plurals like views. |
| Code / enum | <thing>_code, <thing>_status | country_code, order_status | Qualify generic words: order_status, not status. |
Every pattern above is built into the ColumnCaster generator — choose a column type and generate a batch, or use Mixed for a realistic spread across a new table.
Consistency rule: the same concept gets the same name in every table. If it's
created_at in users, it's created_at in orders — never creation_date next door.