Use Doctrine Platform to generate SQL query for table truncation.
This commit is contained in:
parent
9b1c4a1e74
commit
7458e21f2c
|
@ -159,14 +159,9 @@ class Helper {
|
|||
return false;
|
||||
}
|
||||
|
||||
$dbtype = \OCP\Config::getSystemValue('dbtype');
|
||||
if(strpos($dbtype, 'sqlite') !== false || $dbtype === 'oci') {
|
||||
$query = \OCP\DB::prepare('DELETE FROM '.$table);
|
||||
} else {
|
||||
$query = \OCP\DB::prepare('TRUNCATE '.$table);
|
||||
}
|
||||
|
||||
|
||||
$connection = \OC_DB::getConnection();
|
||||
$sql = $connection->getDatabasePlatform()->getTruncateTableSQL($table);
|
||||
$query = \OCP\DB::prepare($sql);
|
||||
$res = $query->execute();
|
||||
|
||||
if(\OCP\DB::isError($res)) {
|
||||
|
|
Loading…
Reference in New Issue