feat(showcase): 去掉 Bento 灵感类型,只保留 hero / work

后端校验、分组、后台列表,以及后台页面与首页取图都只认
hero 和 work;启动时清掉遗留的 bento 记录。

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
2026-10-27 15:57:12 +08:00
co-authored by Devin
parent 2fa0324a66
commit 8b85d5623a
6 changed files with 20 additions and 36 deletions
+4
View File
@@ -72,6 +72,10 @@ func NewApp(ctx context.Context) (*App, error) {
if err := db.WithContext(ctx).Exec(`ALTER TABLE model_configs DROP COLUMN IF EXISTS enabled`).Error; err != nil {
return nil, fmt.Errorf("drop model_configs.enabled: %w", err)
}
// 首页展示位不再支持 bento,清掉遗留记录。
if err := db.WithContext(ctx).Exec(`DELETE FROM showcase_items WHERE kind = 'bento'`).Error; err != nil {
return nil, fmt.Errorf("purge bento showcase: %w", err)
}
if err := seedDefaults(ctx, db); err != nil {
return nil, fmt.Errorf("seed defaults: %w", err)
}