hlathery / Virtual-Ecosystem

0 stars 0 forks source link

Schema/API Design Comments Cory Cowden #11

Open coryfcowden opened 6 days ago

coryfcowden commented 6 days ago

Schema/API Design Comments

  1. Many foreign keys are set up as “null”. Consider making “not null” if they need to always exist – for example, a villager may always need a job_id, even if 0 for unassigned.
  2. Instead of having separate rows for each building cost in the catalog table, consider combining it to create a new column in the buildings table to display the cost, instead of having a separate catalog table
  3. Rename “entitys” table to “entities” for correct spelling
  4. Villagers and biomes are not connected. Consider adding a biome_id to villagers table to be able to track what biome the villager is in
  5. Consider restricting nourishment from 0-100. Restricting the values could make it clearer
  6. Consider renaming primary key, “inventory_pkey” from the buildings table to “buildings_pkey” for clarity
  7. Consider restricting what values can be set for values like quantity, like only positive numbers
  8. Consider adding a status column to villagers table to identify if a villager is alive, dead, or dying (if nourishment is too low or age is too high)
  9. Consider adding a default biome for villagers to prevent incomplete values when creating a villager
  10. Consider making important values such as biome_id in villagers set to “not null”
  11. Consider setting restrictions on job types, so that only valid inputs can be passed
  12. Consider setting default values in buildings, such as 0 for quantity so that you do not end up with null errors