I'm working on an MySQL Database for my website but I'm not sure on how to proceed now. I get to the point where actions have requirements in multiple other tables, but also have influences in multiple other tables.
In my end design I will have at least 6 tables that an action has potential requirements for and a potential influence on.
Now, there are 2 ways I've thought of it myself:
1 Make action_req_x
and action_inf_x
tables for every x which would look like this:
action_id ...
x_id ...
minvalue ...
maxvalue ...
Where the minvalue and maxvalue can be changed upon which table it's refferencing. For example, stats would be Decimal(10,3) and items would be Integer(1). This method would require a LOT of tables and I can't believe I've found the best method on my own.
2 Make action_req_x
and action_inf_x
tables, but only one of each, which would look like this:
action_id ...
x_tablename ...
x_id ...
minvalue ...
maxvalue ...
but this wouldn't be perfect, because different tables have different types of values and I wouldn't know how to setup FK's :( I don't necessarily think this is a really good way to go, but it's better than nothing..
Now, so far I've only talked about the influences and requirements for actions, now I'm not sure yet, but I might eventually want items to have requirements and influences as well, which would require even MOOOORE tables!
My question: Is there a better way to handle this than my first method? Or is there a way I can alter my second method and make that work better? How would database professionals attack this problem?