fix: Set explicit transaction mode on Go register

This commit is contained in:
Mike Fridman 2023-11-09 09:45:12 -05:00
parent 04e12b88f4
commit 3fade11d08
No known key found for this signature in database

View File

@ -22,8 +22,8 @@ func AddNamedMigrationContext(filename string, up, down GoMigrationContext) {
if err := register( if err := register(
filename, filename,
true, true,
&GoFunc{RunTx: up}, &GoFunc{RunTx: up, Mode: TransactionEnabled},
&GoFunc{RunTx: down}, &GoFunc{RunTx: down, Mode: TransactionEnabled},
); err != nil { ); err != nil {
panic(err) panic(err)
} }
@ -44,8 +44,8 @@ func AddNamedMigrationNoTxContext(filename string, up, down GoMigrationNoTxConte
if err := register( if err := register(
filename, filename,
false, false,
&GoFunc{RunDB: up}, &GoFunc{RunDB: up, Mode: TransactionDisabled},
&GoFunc{RunDB: down}, &GoFunc{RunDB: down, Mode: TransactionDisabled},
); err != nil { ); err != nil {
panic(err) panic(err)
} }