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 @@ -448,7 +448,7 @@ func runesLastIndex(input []rune, target rune) int {
448448}
449449
450450func (p * Postgres ) SetVersion (version int , dirty bool ) error {
451- tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {})
451+ tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {Isolation : sql . LevelSerializable })
452452 if err != nil {
453453 return & database.Error {OrigErr : err , Err : "transaction start failed" }
454454 }
Original file line number Diff line number Diff line change @@ -339,12 +339,12 @@ func runesLastIndex(input []rune, target rune) int {
339339}
340340
341341func (p * Postgres ) SetVersion (version int , dirty bool ) error {
342- tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {})
342+ tx , err := p .conn .BeginTx (context .Background (), & sql.TxOptions {Isolation : sql . LevelSerializable })
343343 if err != nil {
344344 return & database.Error {OrigErr : err , Err : "transaction start failed" }
345345 }
346346
347- query := `TRUNCATE ` + quoteIdentifier (p .config .migrationsSchemaName ) + `.` + quoteIdentifier (p .config .migrationsTableName )
347+ query := `DELETE FROM ` + quoteIdentifier (p .config .migrationsSchemaName ) + `.` + quoteIdentifier (p .config .migrationsTableName )
348348 if _ , err := tx .Exec (query ); err != nil {
349349 if errRollback := tx .Rollback (); errRollback != nil {
350350 err = multierror .Append (err , errRollback )
You can’t perform that action at this time.
0 commit comments