From 3fade11d08dba6df98649125c253d763aedfcf5b Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Thu, 9 Nov 2023 09:45:12 -0500 Subject: [PATCH] fix: Set explicit transaction mode on Go register --- register.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/register.go b/register.go index 23a4f83..524228c 100644 --- a/register.go +++ b/register.go @@ -22,8 +22,8 @@ func AddNamedMigrationContext(filename string, up, down GoMigrationContext) { if err := register( filename, true, - &GoFunc{RunTx: up}, - &GoFunc{RunTx: down}, + &GoFunc{RunTx: up, Mode: TransactionEnabled}, + &GoFunc{RunTx: down, Mode: TransactionEnabled}, ); err != nil { panic(err) } @@ -44,8 +44,8 @@ func AddNamedMigrationNoTxContext(filename string, up, down GoMigrationNoTxConte if err := register( filename, false, - &GoFunc{RunDB: up}, - &GoFunc{RunDB: down}, + &GoFunc{RunDB: up, Mode: TransactionDisabled}, + &GoFunc{RunDB: down, Mode: TransactionDisabled}, ); err != nil { panic(err) }