Closed (fixed)
Project:
Documentation
Component:
Correction/Clarification
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2007 at 02:48 UTC
Updated:
22 Dec 2008 at 14:22 UTC
This page is about SQL naming conventions.
First it provides an example:
SELECT r.rid, p.perm
FROM {role} r
LEFT JOIN {permission} p ON r.rid = p.rid -- may be on one line with prev.
ORDER BY name
Then in the next sentence it offers a tip:
Naming
* Use plural or collective nouns for table names since they are sets and not scalar values.
I may be wrong, but if you re-read the previous example, you see that the sample code does not follow this convention. Although the two were not directly associated, they are both on the same page attempting to illustrate good SQL naming conventions. I recommend changing the table name from {role} to {roles}.
Comments
Comment #1
karldied commentedThe "role" table is named singularly, which is why it is singular in the example. I've changed the text to:
Use plural or collective nouns for table names since they are sets and not scalar values. (Others prefer that table names to match field name, so prefer singular table names. Drupal uses both: blocks, filters, users; but book, poll, role.)
There is a good discussion of three comments on this node about naming convetions, but it is 'best practices' thought.
Comment #2
betz commentedChanged the component to reflect the new component categorization. See http://drupal.org/node/301443
Comment #3
heather commentedSeems to have been fixed.