General developer forum

 
 
Picture of Azmat Ullah
Delete block tables during uninstalling!
 

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: -
Picture of Ankit Agarwal
Re: Delete block tables during uninstalling!
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

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)