refactor: update db migrator

This commit is contained in:
Steven
2024-08-29 08:21:23 +08:00
parent 784d91ab75
commit 85f5f03be9
19 changed files with 307 additions and 412 deletions

View File

@ -18,11 +18,10 @@ func NewTestingStore(ctx context.Context, t *testing.T) *store.Store {
fmt.Printf("failed to create db driver, error: %+v\n", err)
}
resetTestingDB(ctx, profile, dbDriver)
if err := dbDriver.Migrate(ctx); err != nil {
store := store.New(dbDriver, profile)
if err := store.Migrate(ctx); err != nil {
fmt.Printf("failed to migrate db, error: %+v\n", err)
}
store := store.New(dbDriver, profile)
return store
}