mysql - A better database design? -
I am preparing a database and running in a hassle. Okay, there is nothing that I do not like. I will have 1000 different scenarios, and in each scenario I will need to store every single one of 64 different togals. I have worked around it and I have come up with:
Table landscape Scenario_ID Scenario_Name table toggle Scenario_ID Toggle_1 Toggle ... ... toggle_64
< P> It leaves me with a 65 line Toggles table. I am thinking that the "current" or "off" should be better than the 64 columns, but I am being harmed as it may be. I do not want to store the toggle state in a column in a column because it constantly changes, and it is often necessary to read often to parse a CSV, toggle_14 to "close" instead of changing it and reloading it. To update the table, will it be very easy for me to consider any ideas?
Use many-to-many relationships:
table The scenario (ID, name) will be on / off value in the table visibility toggle (landscape eag, toggle id, toggletate) table toggle (id, toggle name)
field, togglestate, landscape toggle table.
If you ever need more than 64 tigers, then it also produces some flexibility.
Comments
Post a Comment