Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Sqlite AUTOINCREMENT issue on Truncate #12

Closed
dluc opened this issue Aug 20, 2010 · 2 comments
Closed

Sqlite AUTOINCREMENT issue on Truncate #12

dluc opened this issue Aug 20, 2010 · 2 comments
Labels

Comments

@dluc
Copy link

dluc commented Aug 20, 2010

As described here http://www.sqlite.org/autoinc.html SQLite AUTOINCREMENT value is not reset with a simple "DELETE FROM tablename".

This causes a problem in PHPUnit_Extensions_Database_Operation_Truncate since SQLite requires two SQL commands to empty a table and reset the autoincrement value.

In PHPUnit_Extensions_Database_DB_MetaData_Sqlite there is a

protected $truncateCommand = 'DELETE FROM';

"PHPUnit_Extensions_Database_Operation_Truncate::execute()" should be slightly changed to allow PHPUnit_Extensions_Database_DB_MetaData_Sqlite::$truncateCommand to be an array like:

protected $truncateCommand = array('DELETE FROM' , 'DELETE FROM sqlite_sequence WHERE name = ?');
@stale
Copy link

stale bot commented Apr 18, 2018

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 18, 2018
@stale
Copy link

stale bot commented Apr 25, 2018

This issue has been automatically closed because it has not had activity since it was marked as stale. Thank you for your contributions.

@stale stale bot closed this as completed Apr 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant