Taken from this article:
- Primary keys are always named
id
whatever the data type is. - Timestamps are past tense, suffixed
…_at
- Date, Time, and Datetime are not timestamps, name them freely.
- Booleans are always positive and start with
is_…
- Numeric columns should be plural, like
guesses
orfailures
- Lists as JSON columns are plural, and may end with 1…_list1
- Complex JSON trees can be named freely, but may end with
…_tree
- Foreign columns always end with
…_id
, likeauthor_id
- Foreign columns using non-id foreign columns can be suffixed as
…_as_id
- Multiple text columns may end with
…_body
- Multiple text columns for binary-encoded data may end with
…_data
- Binary columns always end with
…_blob
or…_binary
- Columns for encoded data always end with
…_encoded
- Columns for encrypted data always end with
…_encrypted