I'm developing a plugin for which I create a specific table. I had actually activated the plugin a couple times before creating the table, and I can't seem to make the module installer run.
I have the following files (assume my module name is xyz, in a folder modules/xyz/):
helpers/xyz_installer.php
- this file has a static function named "install" within a class called "xyz_installer"
- The table name is 'xyz_ids'
models/xyz_id.php
- This simply defines the class "xyz_id_Model" as an extension of "ORM".
I have other files, of course, but as I understand it, those should be the only ones I need to create the table. I deactivate and reactivate the module, but the table is not created. I've also tried deleting the only module variable from the database to no avail. Is there some cache that I need to delete for the installer to pick up?
Thanks!
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module
Posts: 225
Ahh,
I think if you delete the row from the `modules` table, it will install on activation, or something like that. Either that or if you delete the module folder AND delete the row.
Clarification would still be appreicated!
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module
Posts: 814
deleting the row for your module out of the 'modules' table in your database should do the trick and trigger an 'install'
(as a side note, you can also do this in an 'activate' function inside the installer - check if table exists or not, then take appropriate action.)
(there is also "deactivate" that can be used to do something once you deactivate the module, as well as an 'uninstall', which I'm not sure when triggered...)
Posts: 225
@jnash -- now that idea with using the activate function (which I use anyway) to check for the table and install if necessary is smart!
Thanks for the confirmation.
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module