How to Get the Database of Your Plugin Installed During Plugin Installation
In case your plugin has database that must be installed during the installation of the plugin, this is what you must do:
-
Create a directory named
install. The name of this directory must be exactlyinstalland must not change.
-
Put the
installdirectory inside your plugin's directory. For example, if your plugin's directory ismy_plugin, then you must put theinstalldirectory inside themy_plugindirectory like this:my_plugin/install.
-
The database which you want your plugin to install should be in an SQL file with a .sql extension and should be named
install.sql.
-
Put the
install.sqlfile inside theinstalldirectory like so:my_plugin/install/install.sql.
-
That will be it. During installation of your plugin, the
install.sqlwill be installed and will be deleted after the installation.







