always reset auto-increment in tests
Fixes #1431 which unblocks the test failures in CI.
This commit is contained in:
		
							parent
							
								
									541b858145
								
							
						
					
					
						commit
						d3a7269ee1
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue