check if database table exists before drop it
This commit is contained in:
parent
e614e53f04
commit
69cb2d8e9d
@ -15,6 +15,7 @@ declare(strict_types=1);
|
|||||||
namespace Dotclear\Plugin\Uninstaller\Cleaner;
|
namespace Dotclear\Plugin\Uninstaller\Cleaner;
|
||||||
|
|
||||||
use dbSchema;
|
use dbSchema;
|
||||||
|
use dbStruct;
|
||||||
use dcCore;
|
use dcCore;
|
||||||
use Dotclear\Database\Statement\{
|
use Dotclear\Database\Statement\{
|
||||||
DeleteStatement,
|
DeleteStatement,
|
||||||
@ -120,9 +121,12 @@ class Tables extends AbstractCleaner
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
|
$struct = new dbStruct(dcCore::app()->con, dcCore::app()->prefix);
|
||||||
|
if ($struct->tableExists($ns)) {
|
||||||
$sql = new DropStatement();
|
$sql = new DropStatement();
|
||||||
$sql->from(dcCore::app()->prefix . $ns)
|
$sql->from(dcCore::app()->prefix . $ns)
|
||||||
->drop();
|
->drop();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user