Delete block tables during uninstalling!

Delete block tables during uninstalling!

by Azmat Ullah -
Number of replies: 1

Hi!

I have successfully made block plugin but one issue arise when I uninstall the block,database tables of block can't delete.I want to ask some specific questions.

1) Can I delete tables by using mysql drop query(or moodle provide mechanism for uninstalling the table).

2) Is any function exists in Moodle Data Manipulation Api for table deletion.

Thanks!

Average of ratings: -
In reply to Azmat Ullah

Re: Delete block tables during uninstalling!

by Ankit Agarwal -

Hi Azmat,

The database tables should be dropped automatically when the plugin is uninstalled. This might help you have a look.

http://docs.moodle.org/dev/Installing_and_upgrading_plugin_database_tables

As far as goes deleting table using queries you can try $DB->execute() api, but it is not really recomended to delete things this way.

 

Average of ratings: Useful (1)