What is the best practice in naming your “user” table?

前端 未结 5 1912
萌比男神i
萌比男神i 2020-12-23 16:04

Here\'s three best practices I try to follow when naming tables:

  • Never name a table with plural (such as \"users\")
  • Never name a table using a reserve
5条回答
  •  旧巷少年郎
    2020-12-23 17:01

    I use CakePHP rules even when I don't use the framework :

    Table names are by convention lowercase and pluralized with multi-word table names separated by underscores. For example, a Model name of Ingredient expects the table name ingredients. Model name of EventRegistration would expect a table name of event_registrations.

提交回复
热议问题