A friend asked me to build a site with a few "static" and "dynamic" tables.
In fact he wants to have a few tables which can't be deleted, and some "dynamic" tables which can be created directly from site users, according to their needs.
I.E. if the user needs some "optional" that in the current db doesn't exist, he creates a new table for his specific need.
I think this is not a good way to do it, i think it is better to have a list of all possible optionals in a table and then flag them for each user, i.e.:
Table garden(id, camellia, californa_poppy, azalea)
contains a generic garden with 3 flower species that the garden can contain
Table users(id, username, some_user_infos, garden_id)
contains a generic user and it's garden id.
If garden_id
value from table users
is 1
, and line with id 1
from table garden
is (1, 1, 0, 1)
It means that user with garden_id=1
has every allowed flower but California Puppy.
This is my idea.
My friend says it would be better to dinamically create tables and connect them to the user to dinamically define new flowers.
Wouldn't it be better to have every possible flower as a field of the garden
table and flag it as i want to do?