Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

DataBase modelization

Vaubourg Mandel edited this page Jun 17, 2017 · 17 revisions

DATABASE MODELIZATION

MCD

MLD


MLD

MLD


explanations

We have two tables.

  • The first one, the Map table, will contain the name of the map (primary key) and its dimensions (width, height)
  • The second, the ObjectType table, will contain the different types of elements (primary key) that will compose the Map (Dirt, Rock, Monsters, character, Diamond, Wall).

Finally, these two tables are not linked by the ObjectMap relation that will contain the primary key of the Map table, that of the ObjectType table, and this key will additionally be composed of the x and y coordinates (avoids redundancy of entry in the Table).


CUSTOMIZATION DATABASE

  • Updating or deleting an entry in Map is propagated in ObjectMap :
ObjectMap_Map_MapName_fk FOREIGN KEY (MapName) REFERENCES Map (MapName) ON DELETE CASCADE ON UPDATE CASCADE
  • The update of an Object Type entry is propagated in ObjectMap the deletion will be blocked :
ObjectMap_ObjectType_TypeObject_fk FOREIGN KEY (TypeObject) REFERENCES ObjectType (TypeObject) ON UPDATE CASCADE

Clone this wiki locally