I am writing a Joomla component (I've written a number of them), but I haven't used the SQL install/uninstall/update facility before (running Joomla 3.6).
I have the following code in the component.xml file:
<install> <!-- Runs on install -->
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<uninstall> <!-- Runs on uninstall -->
<sql>
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
</sql>
</uninstall>
<update> <!-- Runs on update -->
<schemas>
<schemapath type="mysql">sql/updates</schemapath>
</schemas>
</update>
At this point in the development, all I'm doing is verifying that the install and uninstall scripts run. The first creates a couple of tables, while the second drops them all. The install script works fine, but the uninstall script doesn't seem to run (i.e., the tables aren't dropped). The uninstall script just has two 'drop table if exists' lines.