Function to migrate specific database.

Fixes #28
pull/2/head
Shuhao Wu 2014-05-26 15:22:15 -04:00
parent 9d1a22dde8
commit 1ff4053a43
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ func RunMigrations(conf *DBConf, migrationsDir string, target int64) (err error)
}
defer db.Close()
return RunMigrationsOnDb(conf, migrationsDir, target, db)
}
// Runs migration on a specific database instance.
func RunMigrationsOnDb(conf *DBConf, migrationsDir string, target int64, db *sql.DB) (err error) {
current, err := EnsureDBVersion(conf, db)
if err != nil {
return err