Skip to content

Commit

Permalink
Fix log message format and serializable
Browse files Browse the repository at this point in the history
transaction warning.
  • Loading branch information
adlio committed Dec 9, 2021
1 parent 00d5bb6 commit a8090c3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package schema

import (
"context"
"database/sql"
"fmt"
"time"
)
Expand Down Expand Up @@ -75,7 +74,7 @@ func (m *Migrator) Apply(db DB, migrations []*Migration) (err error) {
}
defer func() { err = coalesceErrs(err, m.unlock(conn)) }()

tx, err := conn.BeginTx(m.ctx, &sql.TxOptions{Isolation: sql.LevelSerializable})
tx, err := conn.BeginTx(m.ctx, nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -103,7 +102,7 @@ func (m *Migrator) lock(tx Queryer) error {
if err != nil {
return err
}
m.log("Locked %s at ", m.QuotedTableName(), time.Now().Format(time.RFC3339Nano))
m.log(fmt.Sprintf("Locked %s at %s", m.QuotedTableName(), time.Now().Format(time.RFC3339Nano)))
}
return nil
}
Expand All @@ -114,7 +113,7 @@ func (m *Migrator) unlock(tx Queryer) error {
if err != nil {
return err
}
m.log("Unlocked %s at ", m.QuotedTableName(), time.Now().Format(time.RFC3339Nano))
m.log(fmt.Sprintf("Unlocked %s at %s", m.QuotedTableName(), time.Now().Format(time.RFC3339Nano)))
}
return nil
}
Expand Down

0 comments on commit a8090c3

Please sign in to comment.