Question

Recently I downloaded some free extensions in magento CE 1.7. One of them had a data folder inside the module folder structure. It contained some data upgrade scripts. At the same time the module had sql folder as well. It also contained one install script and several upgrade scripts. Can anyone clarify why the same module has two folders to keep scripts? What is the difference of data scripts and sql scripts?

Any suggestion would be highly appreciated.

Was it helpful?

Solution

The data folder was introduced in Magento CE 1.6 and EE 1.11. The idea is to split the data structure and the data (insertion).

They work in the same way as install scripts.

Example: If you need to create a new table and fill it with data, you would put the table creation in your sql folder (install- or upgrade-script). Inserting the data into the table would be done in the data folder (install- or upgrade-script).

Edit (to complete the answer according to the comments of Marius and Fabian): The setup scripts in the sql folder are executed in an earlier state, so the config is not fully loaded.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top