Database Column Name Patterns

The standard pattern for every column category — with examples you can copy straight into a migration.

CategoryPatternExamplesNotes
Primary keyid or <table>_idid, user_idPick one style per schema. <table>_id removes ambiguity in joins.
Foreign key<referenced_table>_idorder_id, customer_idMatch the referenced primary key name exactly.
Booleanis_<adjective>, has_<noun>, can_<verb>is_active, has_avatar, can_editReads as a yes/no question. Never a bare adjective.
Timestamp<event>_atcreated_at, deleted_at, last_login_at_at for instants; _date for calendar dates.
Soft deletedeleted_atdeleted_atNULL means active — the standard soft-delete convention.
Auditcreated_by, updated_bycreated_byStores a user or system identifier.
Name / titlename, title, slugdisplay_name, product_slugSingular; qualify only when ambiguous.
Contact<channel> or <channel>_addressemail, email_address, phone_numberemail alone is fine; email_address when the table also has email preferences.
Amount<what>_amount, <what>_pricetotal_amount, unit_priceState what is measured; include currency handling elsewhere.
Count<thing>_countview_count, stock_countPrefer over bare plurals like views.
Code / enum<thing>_code, <thing>_statuscountry_code, order_statusQualify 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.