7

Mysql naming convention: Should I use the past in the field name?

 3 years ago
source link: https://www.codesd.com/item/mysql-naming-convention-should-i-use-the-past-in-the-field-name.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Mysql naming convention: Should I use the past in the field name?

advertisements

Im getting confused on this day fixing the database for having the consistent field name.

When i want to name the field to explain: the name of the one who locked, or hidden the post. What's the field should i use?

locked_by_username , lock_by_username or lock_username hidden_by_username , hide_by_username or hidden_username ?

Present tense or past tense? and should i use by inside the field name, does it a bad practice?

I see many database use post_username or poster_username to describe the username of the one who posted the post.

But with lock and hide verb, i can't see any the good way for describing it.

Sorry, i know this is a really stupid question, but English isn't my native language.


Whether your native language is Kiswahili or Klingon or English, what you want here are column names that describe current state. For example username_holding_lock means the column contains the name of a user holding a lock on the row.

Somebody using a tool to troubleshoot by doing SELECT * will then be able to guess what's up when the value TomSawyer appears on some row.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK