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