Merge pull request #22 from stojg/unittest-speed-improvements
NEW: Improve the unittest running time by not truncating tables
This commit is contained in:
commit
65702e4a6b
|
@ -1369,6 +1369,20 @@ class PostgreSQLDatabase extends SS_Database {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all entries from the table instead of truncating it.
|
||||
*
|
||||
* This gives a massive speed improvement compared to using TRUNCATE, with
|
||||
* the caveat that primary keys are not reset etc.
|
||||
*
|
||||
* @see DatabaseAdmin::clearAllData()
|
||||
*
|
||||
* @param string $table
|
||||
*/
|
||||
public function clearTable($table) {
|
||||
$this->query('DELETE FROM "'.$table.'";');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a boolean type-formatted string
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue