DBmodel » History » Version 12

Version 11 (ddurieux, 06/04/2014 05:27 PM) → Version 12/13 (trasher, 02/24/2017 08:20 AM)

h1. PAGE OUTDATED

*The current page is out-of-date. Please refer to the new documentation to know about database model:
http://glpi-developer-documentation.readthedocs.io/en/latest/devapi/dbmodel.html*

h1.
GLPI Database Model

h2. Database description

* [[DescripTiondb72|Description de la base données GLPI 0.72]]
* [[DescripTiondb|Description de la base données GLPI 0.78]]
* [[SchemaDb|Schéma de la base de données GLPI]]

h2. Nommage des tables de la base de donnée / tables naming of database

h3. français

Les noms des tables sont liés aux noms des classes PHP.
On préfixe 'glpi_' et on met le nom au pluriel.
Voici quelques exemples :

* classe _Ticket_ => table _glpi_tickets_
* classe _ITILCategory_ => table _glpi_itilcategories_
* classe _Computer_SoftwareVersion_ => _glpi_computers_softwareversions_
* classe _PluginExampleProfile_ => _glpi_plugin_example_profiles_

h3. english

The table names are linked with PHP classes names.
We add prefix 'glpi_' and put class name in the plural.
This is some examples :

* class _Ticket_ => table _glpi_tickets_
* class _ITILCategory_ => table _glpi_itilcategories_
* class _Computer_SoftwareVersion_ => _glpi_computers_softwareversions_
* class _PluginExampleProfile_ => _glpi_plugin_example_profiles_

h2. Nommage des champs foreignkey / foreignkey fields naming

h3. français

Lorsque l'on veut avoir une référence à une autre table, on ajoute un champ dont le nommage est :

# On prend le nom de la table en relation
# On enlève le préfix glpi_
# On ajoute le suffixe _id

Voici des exemples

* table _glpi_tickets_ => champ _tickets_id_
* table _glpi_itilcategories_ => champ _itilcategories_id_
* table _glpi_plugin_example_profiles_ => champ _plugin_example_profiles_id_

h3. english

When we want to have a reference to another table, we add a field with naming is:

# We get the table name related
# We remove the prefix glpi_
# We add the suffix _id

This is some examples

* table _glpi_tickets_ => field _tickets_id_
* table _glpi_itilcategories_ => field _itilcategories_id_
* table _glpi_plugin_example_profiles_ => field _plugin_example_profiles_id_

h2. Mysql Workbench scheme

Created using : "MySQL Workbench":http://dev.mysql.com/downloads/workbench/5.2.html (for Linux, version 5.2.38)

Available diagram : Softwares, Users, Tickets