ensureDBVersion(): clean up after the db version query. fixes issue #10.

pull/2/head
Liam Staskawicz 2013-09-25 11:37:19 -07:00
parent 8f76dfe638
commit 5dfd15ece2
1 changed files with 1 additions and 2 deletions

View File

@ -196,13 +196,12 @@ func ensureDBVersion(conf *DBConf, db *sql.DB) (int64, error) {
rows, err := conf.Driver.Dialect.dbVersionQuery(db) rows, err := conf.Driver.Dialect.dbVersionQuery(db)
if err != nil { if err != nil {
if err == ErrTableDoesNotExist { if err == ErrTableDoesNotExist {
return 0, createVersionTable(conf, db) return 0, createVersionTable(conf, db)
} }
return 0, err return 0, err
} }
defer rows.Close()
// The most recent record for each migration specifies // The most recent record for each migration specifies
// whether it has been applied or rolled back. // whether it has been applied or rolled back.