![]() ![]() My issue is, what to do if there are multiple requirements? I won't be able to have a primary key then. Powering the next step in your athletic career 01 Gain Exposure Create a profile for recruiting, complete with images, highlight videos, athletic & academic stats, and more. Level integer NOT NULL, \* and which level is required*\įOREIGN KEY (building_id) REFERENCES master.buildings(id) If there is one or more prerequisites, the value of this column will always be present in a column present in master.building_requirements:īuilding_id integer NOT NULL, \* what building must be present in order to built it *\.This column will be set to 'null' if there is no prerequisites.In this table, I added a requirements_id column. Requirements_id integer NOT NULL, \* the column in question that I added to store prerequisites, set to NULL if no pre-requisites*\įOREIGN KEY (building_id) REFERENCES transactions.buildings(id),įOREIGN KEY (requirements_id) REFERENCES master.buildings_requirements(id) Level INT2, \* level of the building, from 0 to 20, the cost is usually higher when level is higher*\ CREATE TABLEīuilding_id integer NOT NULL, \* the id of the building we want to build or upgrade *\ ![]() Example: To upgrade your building Y to level 10 You must have 100 wood, 50 iron and building A level 7. This table store the cost of upgrade / build a building (ressources and prerequisites). What I has thinking to do is to create 2 different tables: In my PSQL database, I have 2 different schemas, one for transactions tables and one for master tables. So there will be always 3 options when a player want to upgrade / build a building: Note that prerequisites are always building levels. Example: to build building C you must already have building B level 5 and building A level 9. However, to build or upgrade a building, it is possible to have one of more prerequisites. This is a browser game where every player has one or multiple village, with different buildings, and each building can be upgraded to level 20. I am working on a browser game and currently on the data modelling part. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |