[BW-dev-discussion] Forum thread tags in database - new tableforum tags

Morgan Tocker tocker ...
Tue Jan 1 20:06:57 UTC 2008


> > In old BW I have use the following :
> > lowercase for table name

I recommend *always* use lowercase for table name.  In MySQL a table
maps to a file called $tablename.frm on the filesystem.  People
sometimes create tables in windows (insensitive) then move to Linux
and find tables are missing?

We have an option called lower_case_table_names to convert Linux to
insensitive, but it's a pain to enable it.

> > plural name (always) for table name
> > for NxN link tables table1table2 (like memberspreferences)
> > all tables (except some NxN table) have a field id (lowerecase) which is
> > their unique id primary key
> > all tables have a created (lowercase) date when the records was create (this
> > is for administration, debugging, sometime for functiunal use)
> > all links are named IdXxxxxx which generally mean IdXxxx is and index
> > (IdCountry, IdMember, IdOwner ....)
> > fields have a comment, table have a comment

I think this is as bad as coding standards - everyone has an opinion,
and they're all right ;)
My personal preference (but should add no weight to your discussion is):

- Table name is plural ("users" not "user")
- all lower case
- Primary key always called id
- Foreign keys as 'table in singular underscore id' i.e. user_id
- No hungarian notation for tables or generally fields - i.e. no tbl_user

- Morgan


More information about the bw-dev-discussion mailing list