install.xml
defines the database structure for the module. It is recommended that we start with the basic install.xml
file from the NEWMODULE
template. From there, we can use either an XML editor or a text editor to customize the database to our specific needs.
The recommended method to edit the database structure is to use the XMLDB editor from the Site Administration | Miscellaneous menu. This editor allows us to quickly and easily make changes. Although we could easily hand-edit the file, the XMLDB editor makes it an easier and less error-prone process. The editor is especially useful for making upgrades to our database schema as we release new versions of the module. It provides both a new XML file and the PHP code to run in our update.php
file. We will cover the update.php
file in an upcoming section. Following is a screenshot of the XMLDB editor in action.