@@ -99,7 +99,7 @@ func insertMigrationRecord(tx *gofrSql.Tx, query string, version int64, startTim
9999 return err
100100}
101101
102- func rollbackAndLog (c * container.Container , tx * gofrSql.Tx , err error ) {
102+ func rollbackAndLog (c * container.Container , version int64 , tx * gofrSql.Tx , err error ) {
103103 c .Logger .Error (err )
104104
105105 if tx == nil {
@@ -110,22 +110,22 @@ func rollbackAndLog(c *container.Container, tx *gofrSql.Tx, err error) {
110110 c .Logger .Error ("unable to rollback transaction: %v" , err )
111111 }
112112
113- c .Logger .Error ("Migration rolled back" )
113+ c .Logger .Errorf ("Migration %v rolled back" , version )
114114}
115115
116116func sqlPostRun (c * container.Container , tx * gofrSql.Tx , currentMigration int64 , start time.Time ) {
117117 switch c .SQL .Driver ().(type ) {
118118 case * mysql.MySQLDriver :
119119 err := insertMigrationRecord (tx , insertGoFrMigrationRowMySQL , currentMigration , start )
120120 if err != nil {
121- rollbackAndLog (c , tx , err )
121+ rollbackAndLog (c , currentMigration , tx , err )
122122
123123 return
124124 }
125125 case * pq.Driver :
126126 err := insertMigrationRecord (tx , insertGoFrMigrationRowPostgres , currentMigration , start )
127127 if err != nil {
128- rollbackAndLog (c , tx , err )
128+ rollbackAndLog (c , currentMigration , tx , err )
129129
130130 return
131131 }
0 commit comments