[TYPO3-dev] naming conventions database issues
Nikolas Hagelstein
hagelstein at shr.cc
Thu Nov 30 10:50:30 CET 2006
Hi,
i wonder if there are any naming conventions for e.g Database tables
beside that the should
be prefixed with the ext key. Shouldnt we create some?
E.g.
-plural/sigular
-naming of relational tables
-naming of keys (beside the fixe foreign/local naming)
I would suggest the following:
Database tables in general:
-Plural prefixed by the extkey:
e.g: tt_myext_products tt_myext_categories
MM tables:
-Plural
-Eigther in alphabetically order
-Or starting with the "local" table.
e.g.: tt_myext_categories_products_mm
I prefere alphabetically since local/foreign will be obsolete soon
because
relational tables are bi-directional normaly.
If more than one MM table is needed pointing to the same foreign table i
would
suggest adding its functionallity:
eg.
tt_myext_products_products_requiert_mm
tt_myext_products_products_optional_mm
The above sample could be used for cross selling etc.
Solving this issue by using seperated MM tables a real ugly way
and schould normally be done by single MM table have an addional field
"type=optinal/requiert" or something.
But due to typo3 restrictions this isnt possible ATM (unfortunatly).
Foreign keys:
-tablenamewithout_keyfield singular
E.g.:
Eighter tt_myext_category_uid
or category_uid
For blob comma separated key fields (which will hopefully discarded
asap!):
-tablename plural
E.g.:
Eigther tt_myext_categories
or categories
So, what do you think?
Bye,
Nikolas
More information about the TYPO3-dev
mailing list