Skip to content

Database Schema Viewer Tool

Curtis Conard edited this page Nov 24, 2020 · 1 revision

The database schema of GLPI and its plugins can be quite confusing to say the least. There is a whopping 350 tables at this time of writing this wiki article in the core GLPI code alone. To make the issue worse, GLPI's database schema doesn't technically have any foreign keys as far as the database server is concerned. They exist a special column names like users_id (Meaning it links to the ID field in the glpi_users table) but there are no foreign key constraints added to the schema. This makes most database schema visualizer tools useless. The Database Schema Viewer tool allows you to view a table of all fields of a particular table and presents buttons next to the implied foreign key fields to jump to the related class in the Class Viewer or the related table in the Database Schema Viewer tool.

Some tables may have a polymorphic relation with other tables. In those cases, it is likely the table has two columns named itemtype and items_id. The itemtype column is the discriminator column whose value would be the code name for the class the record relates to while the items_id field maps to the id field in that class' table. The Database Schema Viewer tool attempts to make that clear by offering a tooltip next to these fields to explain their purpose.

At the top of the info pane for each table, there is a button that can take you to the class information in the Class Viewer tool if there is a valid class mapped to this table.

Clone this wiki locally