File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ func runesLastIndex(input []rune, target rune) int {
446446}
447447
448448func (p * Postgres ) SetVersion (version int , dirty bool ) error {
449- tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {})
449+ tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {Isolation : sql . LevelSerializable })
450450 if err != nil {
451451 return & database.Error {OrigErr : err , Err : "transaction start failed" }
452452 }
Original file line number Diff line number Diff line change @@ -337,12 +337,12 @@ func runesLastIndex(input []rune, target rune) int {
337337}
338338
339339func (p * Postgres ) SetVersion (version int , dirty bool ) error {
340- tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {})
340+ tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {Isolation : sql . LevelSerializable })
341341 if err != nil {
342342 return & database.Error {OrigErr : err , Err : "transaction start failed" }
343343 }
344344
345- query := `TRUNCATE ` + quoteIdentifier (p .config .migrationsSchemaName ) + `.` + quoteIdentifier (p .config .migrationsTableName )
345+ query := `DELETE FROM ` + quoteIdentifier (p .config .migrationsSchemaName ) + `.` + quoteIdentifier (p .config .migrationsTableName )
346346 if _ , err := tx .Exec (query ); err != nil {
347347 if errRollback := tx .Rollback (); errRollback != nil {
348348 err = errors .Join (err , errRollback )
You can’t perform that action at this time.
0 commit comments