diff --git a/migrate.go b/migrate.go index 3e25fd1..7b083f4 100644 --- a/migrate.go +++ b/migrate.go @@ -159,7 +159,7 @@ func (m *Migrator) getCurrentVersion(ctx context.Context) (string, error) { } func (m *Migrator) inTransaction(ctx context.Context, callback func(tx *sql.Tx) error) error { - tx, err := m.DB.Begin() + tx, err := m.DB.BeginTx(ctx, nil) if err != nil { return errors.New("error beginning transaction: " + err.Error()) }