Skip to content

Commit

Permalink
Remove resetSequence()
Browse files Browse the repository at this point in the history
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 5f905f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
13 changes: 0 additions & 13 deletions lib/Cake/Database/Connection.php
Expand Up @@ -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
*
Expand Down
11 changes: 1 addition & 10 deletions lib/Cake/TestSuite/Fixture/TestFixture.php
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5f905f0

Please sign in to comment.