mysql - Data model. ¿Pluralize or not pluralize the names of the tables? -
hello everyone. whenever start develop new data model application have same question:
is convenient pluralize names of tables?
where table stored, example, users; call 'users' or 'user'?
i not pluralize, because data model, generated entities orm , seems more correct instantiate new 'user' new 'users'.
i know think it.
greetings all!
i guess depends on going use database for:
i not pluralize, because data model, generated entities orm , seems more correct instantiate new 'user' new 'users'.
but don't give information regarding language use besides sql, framework, tools.
i best conform standards of framework or orm, instance in .net entity framework tables generated singular notation , class names map these tables singular well, whereas in ruby on rails activerecord generated pluralized in database mapping classes singular.
there no better way think but, if data application ever going more important application (as in, may migrate framework or language different) or if there going others working directly on database (people doing reports, dba's, analysts etc.) i'd suggest make tables plural database people more keen use way.
if think @ database level pluralizing makes sense, users
table going have more 1 user, , on , forth. why want store data in table fashion if weren't going store more 1 record same structure? makes sense pluralize.
if create array type of data in x language, let's say, users, don't call user
you call users
probably, because may contain more one, if store 1 thing on initially.
so reasoning behind why pluralize table name approach, besides, can setup mappings in orm if pluralizing breaks convention can set user
class maps users
table instance.
update: here discussion on stackexchange's dba make point regarding joint associations
Comments
Post a Comment