General developer forum

Delete block tables during uninstalling!

Picture of Azmat Ullah
Delete block tables during uninstalling!


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.


Average of ratings: -
Picture of Ankit Agarwal
Re: Delete block tables during uninstalling!
Core developersMoodle HQPlugin developersTesters

Hi Azmat,

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

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)