Skip to content
Permalink
Browse files

Remove resetSequence()

The only driver that needed it was postgres. However, using truncate
with RESET IDENTITY will force automatically reset the related
sequences.
  • Loading branch information...
markstory committed May 26, 2013
1 parent 4d40083 commit 5f905f0602b8c991dcd711846a4357a4f8991071
Showing with 1 addition and 23 deletions.
  1. +0 −13 lib/Cake/Database/Connection.php
  2. +1 −10 lib/Cake/TestSuite/Fixture/TestFixture.php
@@ -431,19 +431,6 @@ public function rollbackSavepoint($name) {
$this->execute($this->_driver->rollbackSavePointSQL($name));
}
/**
* Reset a sequence.
*
* Useful with database platforms that support sequences.
*
* @param string $table The table to reset.
* @param string $key The key to reset.
* @return boolean
*/
public function resetSequence($table, $key) {
// TODO implement this.
}
/**
* Quotes value to be used safely in database query
*
@@ -282,16 +282,7 @@ public function insert(Connection $db) {
$query->values($row);
}
$result = $query->execute();
$primary = $this->_schema->primaryKey();
if (
count($primary) == 1 &&
in_array($this->_schema->column($primary[0])['type'], ['integer', 'biginteger'])
) {
$db->resetSequence($this->table, $primary[0]);
}
return $result;
return $query->execute();
}
return true;
}

0 comments on commit 5f905f0

Please sign in to comment.
You can’t perform that action at this time.