diff --git a/functional/db_test.go b/functional/db_test.go index f4bc53eb..dbb7df70 100644 --- a/functional/db_test.go +++ b/functional/db_test.go @@ -40,10 +40,12 @@ func connect(t *testing.T) *gorp.DbMap { t.Fatalf("Unable to drop database tables: %v", err) } - if err = c.CreateTablesIfNotExists(); err != nil { - t.Fatalf("Unable to create database tables: %v", err) + if err = db.DropMigrationsTable(c); err != nil { + panic(fmt.Sprintf("Unable to drop migration table: %v", err)) } + db.MigrateToLatest(c) + return c } diff --git a/functional/repo/testutil.go b/functional/repo/testutil.go index 63bc963f..8b2d0b79 100644 --- a/functional/repo/testutil.go +++ b/functional/repo/testutil.go @@ -18,8 +18,10 @@ func initDB(dsn string) *gorp.DbMap { panic(fmt.Sprintf("Unable to drop database tables: %v", err)) } - if err = c.CreateTablesIfNotExists(); err != nil { - panic(fmt.Sprintf("Unable to create database tables: %v", err)) + if err = db.DropMigrationsTable(c); err != nil { + panic(fmt.Sprintf("Unable to drop migration table: %v", err)) } + + db.MigrateToLatest(c) return c }