Column names - (created, modified) vs. (creation, modification) [closed]
-
23-01-2021 - |
Question
I have a database schema where all the tables are required to have a column to hold the timestamp for the initial INSERT
and another column that holds the timestamp of the last UPDATE
.
Initially this column will have the same value as the one used for the INSERT
timestamp.
I can't decide if it's more appropriate to call them created
and modified
or maybe creation
and modification
.
Suggestions for different names are also welcome.
Solution
Of those two options creation
/modification
as that is less ambiguous.
Looking at some SQL or documentation for the structure that doesn't include column type information, created
/modified
could be mistaken for boolean values.
Furthermore, I'd be inclined to be more specific and use creationTime
/modificationTime
or createdTime
/modifiedTime
, probably the latter because it is vaguely quicker to type.
OTHER TIPS
The database software does not care either way. Only the humans will get excited by this. Why not ask them (him? her?) which is preferred. Both are grammatically correct.
The important point is to pick one convention and apply it rigorously.
Also, look into temporal tables. They will give the same semantics with a much richer history. If your DBMS does not support them natively they can be implemented using triggers.