I have two types of items in my game, consumables, and equipment. For my database, should I store them in two different tables, or all in one big items table?
-
\$\begingroup\$ What is the fundamental difference between the two? Can your equipment eventually be consumed (e.g. it has durability and ends up breaking)? \$\endgroup\$– Vaillancourt ♦Oct 7, 2019 at 19:16
-
\$\begingroup\$ No, equipment will last forever. Consumables are one time use. Equipment can be put on a character, have restrictions (e.g. bows are archer only, need to be x level), while consumables have no restrictions and can not be put on a character. \$\endgroup\$– super potatoOct 7, 2019 at 19:25
-
\$\begingroup\$ Can you put arrows on character? \$\endgroup\$– Vaillancourt ♦Oct 7, 2019 at 19:45
-
\$\begingroup\$ No, just weapon \$\endgroup\$– super potatoOct 7, 2019 at 23:17
1 Answer
If you'll be managing both consumable and non-consumable in essentially the same way, it makes sense to put them in the same table.
This will make the management of the inventory much easier, and will let you create feature you do not think about now, such as wearing Arrows (because you have different types of arrows, you must let your user which type of arrows they consume).