always reset auto-increment in tests

Fixes #1431 which unblocks the test failures in CI.
This commit is contained in:
Jeff Hodges 2016-01-26 13:53:08 -08:00
parent 541b858145
commit d3a7269ee1
1 changed files with 5 additions and 1 deletions

View File

@ -70,7 +70,11 @@ func deleteEverythingInAllTables(db CleanUpDB) error {
// rejecting the DELETE for not having a WHERE clause.
_, err := db.Exec("delete from `" + tn + "` where 1 = 1")
if err != nil {
return err
return fmt.Errorf("unable to delete all rows from table %#v: %s", tn, err)
}
_, err = db.Exec("alter table `" + tn + "` AUTO_INCREMENT = 1")
if err != nil {
return fmt.Errorf("unable to reset autoincrement on table %#v: %s", tn, err)
}
}
return err