LDAP: sqlite compatibility for emptyiing tables

This commit is contained in:
Arthur Schiwon 2013-05-31 20:07:13 +02:00
parent c49ee4d3e3
commit 2ff9677cd1
1 changed files with 7 additions and 1 deletions

View File

@ -118,7 +118,13 @@ class Helper {
return false; return false;
} }
$query = \OCP\DB::prepare('TRUNCATE '.$table); if(strpos(\OCP\Config::getSystemValue('dbtype'), 'sqlite') !== false) {
$query = \OCP\DB::prepare('DELETE FROM '.$table);
} else {
$query = \OCP\DB::prepare('TRUNCATE '.$table);
}
$res = $query->execute(); $res = $query->execute();
if(\OCP\DB::isError($res)) { if(\OCP\DB::isError($res)) {