Database Date Fields - Naming Convention

What is a good way to name date / date fields? I can’t decide if I want to use things like expiry_date , end_time , created_on or just expires , modified .

+7
naming-conventions database-design
source share
3 answers

I think that any standard is in order, but personally, I find the name of the "modified" column ambiguous, not seeing the data type associated with it - is it a logical value, date or user ID? I would prefer "modified_on", "modify_date", "is_modified", "modified_by" or something like that.

+7
source share

I usually use "date_" as a prefix:

 date_created date_end date_deleted date_modified 

As long as you agree, you must be in good shape. In addition, if you are working on an existing product, follow their standard. Changing conventions part of the way through is simply annoying for the people behind you.

+5
source share

I know this is pretty old, but I would like to drop the suffix "At". So CreatedAt, or ModifiedAt. Kinda makes sense in a standard approach and does not require a type in the name.

+3
source share

All Articles