In your module's root directory, create a new directory named
install. In this directory, create one file named
install.sql; this file will contain the new table creation:
CREATE TABLE IF NOT EXISTS `PREFIX_mymod_carrier_cart` ( `id_mymod_carrier_cart` int(11) NOT NULL AUTO_INCREMENT, `id_cart` int(11) NOT NULL, `relay_point` text NOT NULL, `date_add` datetime NOT NULL, PRIMARY KEY (`id_mymod_carrier_cart`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
In the source code of this chapter, I also created an
uninstall.sql file as an example. However, it is better not to delete data on module uninstallation to avoid the loss of data on orders.