php - CakePHP naming conventions in table names -


for cakephp app i'm thinking database table names follow cakephp naming conventions. many times come across general table contains information not entity on it's own contains additional entity information. information in table intended re use placed apart main entity table.

for example: work products can master products. in case table "products" link table "master_product_information" information don't want in "products" table.

another example: table contains meta data of multiple pages. name table "pages_metadata", cake needs plural , "pages_metadatas" doesn't seem right. once again go "pages_metadata_information".

how name tables not contain entities? [entity]_information one?

i hope hear recommendations.

thanks.

the right answer (imo) go cakephp conventions - life easiest way, if have occasional awkward table name.

in case, i'd name "master_product_information" table master_products. fact contains "information" master_product doesn't need specified in table name. table stores info customers "customers" table, not "customer_information" table.

for "pages_metadata_information", i'm pretty sure 'metadata' plural term. i'd go name page_metadata, or metadata. fact metadata associated page, or pages, doesn't need specified in table name. how "teachers" table wouldn't called "students_teachers", though teacher associated students.

your table names might little awkward, that's less hassle breaking conventions, , you'll used pretty quickly.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -