mcdview blog
EN FR
← Back to the blog

In the wild

Dolibarr, GLPI, PrestaShop: fifteen years of database schema, release by release

Three open-source projects born in France keep their full database schema in git. We replayed it release by release, 70 versions from 2009 to 2026, as live diagrams with time-lapses. Three ways to model a large business application, and what each one costs.

Where the data comes from

Each project ships the SQL that creates its database: one file per table for Dolibarr (htdocs/install/mysql/tables/), one dump for GLPI (install/mysql/glpi-empty.sql) and PrestaShop (install-dev/data/db_structure.sql). We took that SQL at every major or minor release tag, dated by the tagged commit, and loaded each state into mcdview as a pinned version.

10015020025030035040045020102014201820222026DolibarrGLPIPrestaShop
Number of tables, release by release. One point per release, 70 in all.

All three grew, at very different speeds: Dolibarr from 151 to 410 tables, GLPI from 141 to 447, PrestaShop from 179 to 244. The interesting part is how each one links those tables together.

Dolibarr: foreign keys, but on one column in five

Dolibarr is the only one of the three that declares foreign keys. Its convention is clear: a column that points to another table starts with fk_. In 24.0.0, 1,102 columns follow it, and 232 of them (21%) carry an actual constraint. The ratio has barely moved since 2.9.0 (22%): new tables get the same treatment as old ones.

The rest is checked by PHP code, or not at all. The most referenced table is llx_user, with 44 tables pointing to it through a declared key, mostly to record who created or wrote a row.

GLPI: no foreign key at all, and one release that renamed everything

GLPI declares no foreign key, in any version. What it has instead is a strict naming convention: users_id points to glpi_users.id, users_id_tech too, with a suffix for the role. The diagram follows that convention, so 897 relations show up in 12.0.0. They are inferred from names: the database enforces none of them.

That convention did not always exist. Version 0.78 (October 2010) rewrote the whole schema in one go: 120 tables removed, 142 added, most of them the same tables renamed (glpi_auth_ldap becomes glpi_authldaps, glpi_cartridges_type becomes glpi_cartridgeitemtypes), and every FK_users column becomes users_id. The diff is the most spectacular of the three projects.

GLPI has a good reason not to declare keys: much of its model is polymorphic. A row points to "an item" through a pair itemtype + items_id (a computer, a printer, a phone), and no foreign key can express that. The center of gravity is glpi_entities, referenced by 171 tables: multi-tenancy, everywhere.

PrestaShop: the shop and the language in every corner

PrestaShop does not declare foreign keys either, but names its columns id_<table>: id_product, id_address_delivery. Read that way, two tables dominate: ps_shop (63 tables) and ps_lang (51). Multistore arrived with the 1.5 branch: between the 1.5.0.0 preview and 1.5.1, 58 tables appear, including 14 _shop association tables and the whole cart-rule family.

Then the time-lapse shows something odd. Version 1.7.0 removes 21 tables from the SQL file. Eleven are features that were dropped (scenes, the product comparator, the old theme tables). The other ten (attributes, languages, shops) did not leave the database: PrestaShop 1.7 started creating them from Doctrine entities, PHP classes, and the schema was split between two sources. For eight years the SQL file showed a shop without ps_shop or ps_lang. Version 9.0 puts those ten back in the SQL, along with nine other tables Doctrine was already managing.

What this says about your own schema

Method and limits. One state per release tag (Dolibarr 2.9.0 to 24.0.0, GLPI 0.72 to 12.0.0, PrestaShop 1.5.0.0 to 9.2.0), dated by the tagged commit; identical consecutive states are merged. For GLPI and PrestaShop the diagram's relations are inferred from column names and added to the SQL, which declares none; polymorphic columns are left out. For Dolibarr, comment lines are stripped and each state is read twice by mcdview 0.34.5 (native and MySQL parsers), keeping the union: the native parser drops foreign keys written with a double space, the MySQL one rejects a table whose SQL is invalid in 17.0. Every declared table is counted. Corrected on November 4: a first version missed 3 tables from 20.0 on, including llx_societe, and showed 190 relations in 24.0 instead of 216. The scripts are extraire_fr3.py and analyser_fr3.py.

More like this: ten open-source schemas in the wild, fifteen years of LinuxFr.org.