|
I have some data that is configuration data for the games I will be including in thesystem.
Each game will have a set of up to a possible 12 mappings per game configuration.
Each mapping is identified by a number 1 to 12 and maps to a string.
so a table like this would describe a mapping if it were in its own table:
Create mapping1(
id int AUTO_INCREMENT PRIMARY KEY,
action varchar (100) NOT NULL
);
Each game will use between 1 and all 12 mappings depending on its requirements and these will not always be the same for each value.
So Mapping 1 could be Load(fred) for game1 and Load(fred(3)) for game2 and game 1 might use all 12 while game 2 might only use mapping 3 and mapping 7.
Can anyone recommend a sane and normalised way to store this data?
I considdered a table for each of the mappings (as above)and then a game config table like this:
Create gameconfig(
id int AUTO_INCREMENT PRIMARY KEY,
gameid int NOT NULL REFERENCES game (id),
mapping1id int REFERENCES mapping1 (id),
mapping2id int REFERENCES mapping2 (id),
mapping3id int REFERENCES mapping3 (id),
mapping4id int REFERENCES mapping4 (id),
mapping5id int REFERENCES mapping5 (id),
mapping6id int REFERENCES mapping6 (id),
mapping7id int REFERENCES mapping7 (id),
mapping8id int REFERENCES mapping8 (id),
mapping9id int REFERENCES mapping9 (id),
mapping10id int REFERENCES mapping10 (id),
mapping11id int REFERENCES mapping11 (id),
mapping12id int REFERENCES mapping12 (id),
);
Now this seems like a waste of table space if some games are not going to use all the mappings, some may only use two.
Any input will be greatly appreciated.
Thanks in advance
Chris.
|