What term use 'date' or 'create_at'?

Asked

Viewed 65 times

-2

Contextualizing:
I have the following table and store the creation date in the attribute date.

+------------+
| Operation  |
+------------+
| id         |
| amount     |
| type       |
| date       | 
| product_id | 
+------------+

I want to know which term fits best in this context, date or create_at?

  • 3

    in most databases date is a data type, and it is not good to have that name, the good same would be different names of the data type that may exist in the bank, example as posed in your question created, updated, etc ... Then check if there was this type of data in the bank if there is no date ...

  • 1

    Just one comment, the right one in English is created_at.

2 answers

3


It depends on what you’re referring to.

If you want to keep a creation date for record then I think it would be convenient to appoint to create_at (to maintain the adopted standard).

Now if "Operation" is an execution date, then it is convenient to keep as date.

2

It doesn’t really have a clear context, but because you’re thinking about CreateAt I imagine that this is the context and then it should be used, after all the names should say exactly what they are. When you use date in the background is giving the name of the column equal to its type and this gives no semantics whatsoever it is, is the worst use of hungarian notation, because the prefix becomes the only part of the name.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.