Understanding PrestaShop.

To be able to understand and think in PrestaShop. We first need to get to know the PrestaShop database. A model database is available for version (SQL Schema) [here].

However, for PrestaShop 1.7 The database structure of PrestaShop can be found in install/data/db_structure.sql [github]

From here, we can also read that not all database structure is stored in db_structure.sql file. Part of tables are by doctrine library when working with data model stored in src/PrestaShopBundle/Entity/ directory. We read:

Table in DB but not in db_structure.sql

With PrestaShop 1.7, some tables are now linked to Doctrine entities (i.e stocks). If their ObjectModel (= legacy) equivalent does not exist, the entity is probably only managed by Doctrine.

In that case, updating the table can be done by modifying the related entity stored in src/PrestaShopBundle/Entity/.

After database structure is imported to MySQL database. The data get pushed from install/data/xml/ each xml file represent single entity (table). XML files are structured following ObjectModel structure.


In some PrestaShop versions, data might be kept in install/data/db_data.sql


Would love your thoughts, please comment.x