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 1.4.7.2 (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.

https://github.com/PrestaShop/PrestaShop/tree/1.7.8.x/install-dev/data/xml

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


https://devdocs.prestashop.com/1.7/development/database/structure/
https://doc.prestashop.com/plugins/viewsource/viewpagesrc.action?pageId=3014680
https://doc.prestashop.com/display/PS17/English+documentation

0
Would love your thoughts, please comment.x
()
x