Question

I have some trouble with my MantisBT plugin table. The plugin itself is installed and running but the plugin table is not created while installing the plugin.

I simply added the schema-function to my plugin class to create the table:

function schema()
{       
    return array(
            array("CreateTableSQL", array(plugin_table("test"), "
                id I NOTNULL UNSIGNED AUTOINCREMENT PRIMARY
            "))
    ); 
}

The same for third party plugins: tables are not created while installing them!

I'm using MantisBT 1.2.14 and XAMPP 1.7.7. on Windows 7. The database user by the way has ALL PRIVILEDGES for actions on the database.

Where can the problem be? And does anybody know a good documentation about schema definition for mantis?

Was it helpful?

Solution

I found the solution. Mantis creates a config data set in the "mantis_config_table" while creating the data table.

If one deletes this data set (for a plugin "Test" it would be the set with config_id "plugin_Test_schema") or sets the value to -1 one is able to upgrade/create the data table if not available in the data base yet. You can do this as administrator in the "Manage / Manage Plugins" menu.

Hint: It is also possible to edit/delete the config directly for your plugin as administrator in the "Manage/ Manage Configuration" menu.

OTHER TIPS

My process when reinstalling the plugin has been.

1) uninstall the plugin with mantis: Manage / Manage Plugins
2) delete plugin config with mantis: Manage / Manage Configuration
3) drop the table with mysql: DROP TABLE your_plugin_table_name;

Another nice solution would be creating a function plugin_callback__uninstall() that drop the tables created.

Mantis Plugin Documentation (see bottom of the page)

Hope this helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top