added season types and changed new season to be a modal

This commit is contained in:
2026-02-18 19:43:54 +11:00
parent 103da78f0b
commit b018628d4c
13 changed files with 561 additions and 263 deletions

View File

@@ -498,13 +498,22 @@ func ResetDatabase(ctx context.Context, cfg *config.Config) error {
conn := db.NewDB(cfg.DB)
defer func() { _ = conn.Close() }()
models := conn.RegisterModels()
conn.RegisterModels()
for _, model := range models {
if err := conn.ResetModel(ctx, model); err != nil {
return errors.Wrap(err, "reset model")
}
err = RunMigrations(ctx, cfg, "rollback", "all")
if err != nil {
return errors.Wrap(err, "RunMigrations: rollback")
}
err = RunMigrations(ctx, cfg, "up", "all")
if err != nil {
return errors.Wrap(err, "RunMigrations: up")
}
// for _, model := range models {
// if err := conn.ResetModel(ctx, model); err != nil {
// return errors.Wrap(err, "reset model")
// }
// }
fmt.Println("✅ Database reset complete")
return nil