We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In postgres TRUNCATE TABLE doesn't reset the identity by default.
TRUNCATE TABLE
When running respawn.ResetAsync(conn) this sql is executed:
respawn.ResetAsync(conn)
truncate table <list of tables> cascade;
Respawn/Respawn/PostgresDbAdapter.cs
Line 197 in 2ad376d
To make it reset the identity this needs to be executed:
truncate table <list of tables> restart identity cascade;
Here's a workaround for anyone else stumbling over this:
// workaround for Respawn not resetting identity // await _respawner.ResetAsync(connection); var sql = _respawner.DeleteSql?.Replace("cascade", "restart identity cascade"); var cmd = connection.CreateCommand(); cmd.CommandText = sql; await cmd.ExecuteNonQueryAsync();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In postgres
TRUNCATE TABLE
doesn't reset the identity by default.When running
respawn.ResetAsync(conn)
this sql is executed:Respawn/Respawn/PostgresDbAdapter.cs
Line 197 in 2ad376d
To make it reset the identity this needs to be executed:
Here's a workaround for anyone else stumbling over this:
The text was updated successfully, but these errors were encountered: