Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Setup) uninstall application table cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Oct 18, 2022
1 parent c0da8b2 commit 6ce45ba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tine20/Setup/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2247,6 +2247,11 @@ protected function _uninstallApplication(Tinebase_Model_Application $_applicatio
Setup_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Uninstall ' . $_application);
try {
$applicationTables = Tinebase_Application::getInstance()->getApplicationTables($_application);
$applicationTables = array_diff($applicationTables, [
'applications',
'application_states',
'application_tables'
]);
} catch (Zend_Db_Statement_Exception $zdse) {
Setup_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . " " . $zdse);
throw new Setup_Exception('Could not uninstall ' . $_application . ' (you might need to remove the tables by yourself): ' . $zdse->getMessage());
Expand Down Expand Up @@ -2311,7 +2316,13 @@ protected function _uninstallApplication(Tinebase_Model_Application $_applicatio
throw new Setup_Exception('dead lock detected oldCount: ' . $oldCount);
}
} while (count($applicationTables) > 0);


if ($_application->name == 'Tinebase') {
$db->query('DROP TABLE ' . SQL_TABLE_PREFIX . 'applications');
$db->query('DROP TABLE ' . SQL_TABLE_PREFIX . 'application_states');
$db->query('DROP TABLE ' . SQL_TABLE_PREFIX . 'application_tables');
}

if ($disabledFK) {
if ($db instanceof Zend_Db_Adapter_Pdo_Mysql) {
Setup_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . " Enabling foreign key checks again... ");
Expand Down

0 comments on commit 6ce45ba

Please sign in to comment.