feat: add multi-source breed encyclopedia and two-hour refresh sessions
ci-cd / verify (push) Successful in 1m59s
ci-cd / deploy (push) Skipped

This commit is contained in:
2026-10-05 13:38:24 +08:00
parent 607d709100
commit 9d7cf720a5
73 changed files with 25771 additions and 264 deletions
+4
View File
@@ -9,6 +9,7 @@ import (
"gorm.io/gorm/logger"
"gorm.io/gorm/schema"
"github.com/sundynix/pets-be/internal/breeds"
"github.com/sundynix/pets-be/internal/config"
"github.com/sundynix/pets-be/internal/model"
)
@@ -39,5 +40,8 @@ func Migrate(db *gorm.DB) error {
if err := db.AutoMigrate(model.All()...); err != nil {
return err
}
if _, err := breeds.Seed(db); err != nil {
return err
}
return db.Exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_sundynix_walk_one_active_per_user ON sundynix_walk (user_id) WHERE status IN ('active', 'paused')").Error
}