ZF-11307: Reset sequence number when truncating table during PHPUnit test -> only for PostgreSQL
During a Zend_Test_PHPUnit_DatabaseTestCase setup phase the tables from getDataSet() will be truncated. If PostgreSQL is the backend, the truncate operation is done by the following command:
'TRUNCATE '.$tableName.' CASCADE' (line 109, Zend_Test_PHPUnit_Db_Operation_Truncate)
PostgreSQL has the possibility to reset the sequence numbers during truncate. This is described in http://postgresql.org/docs/8.4/… .
IMHO it makes sense to extend the truncate command for PostgreSQL like this.
$db->query('TRUNCATE '.$tableName.' RESTART IDENTITY CASCADE');
This command resets the sequence number of the primary key.