[documentation] [Documentation bug] Contradiction on http://drupal.org/node/2497
karldied
drupal-docs at drupal.org
Thu Jan 25 12:28:19 UTC 2007
Issue status update for
http://drupal.org/node/112560
Post a follow up:
http://drupal.org/project/comments/add/112560
Project: Documentation
Version: <none>
Component: Developer Guide
Category: bug reports
Priority: minor
Assigned to: Anonymous
Reported by: mikesmullin
Updated by: karldied
Status: active
The "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.
karldied
Previous comments:
------------------------------------------------------------------------
Thu, 25 Jan 2007 02:48:30 +0000 : mikesmullin
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}.
More information about the documentation
mailing list