23.02.2015 Views

www.it-ebooks.info

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Frontend Development<br />

A word on naming conventions: Since Magento 1.6, the setup<br />

script naming conventions have changed. Originally, the Mysql4-<br />

install-x.x.x.php naming convention was used and is currently<br />

deprecated but still supported.<br />

Since Magento 1.6, the naming convention for the setup script has changed and now<br />

developers can make use of three different script types:<br />

• Install: This script is used when the module is first installed and no record of<br />

<strong>it</strong> exists on the core_resource table<br />

• Upgrade: This script is used if the version in the core_resource table is<br />

lower than the one in the config.xml file<br />

• Data: This script will run after the matching version install/upgrade script<br />

and are used to populate the tables w<strong>it</strong>h required data<br />

Data script are introduced in Magento 1.6 and are stored under<br />

the data/directory directly under our Module root. They follow a<br />

slightly different convention than the install and upgrade scripts<br />

by adding the prefix.<br />

Let's continue creating our registry ent<strong>it</strong>y table in our installation script under.<br />

The file location is app/code/local/Mdg/Giftregistry/sql/mdg_giftregistry_<br />

setup/install-0.1.0.php. Refer to the following code:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!