feat(*): 生图与视频工作台 - 新增独立生成流程并整合平台配置
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const CurrentSchemaVersion int64 = 53
|
||||
const CurrentSchemaVersion int64 = 54
|
||||
|
||||
const baselineSchemaChecksum = "sha256:open-ai-canvas-schema-v1-20260830"
|
||||
const schemaMigrationAppliedAtIndexChecksum = "sha256:schema-migrations-applied-at-index-v2-20260830"
|
||||
@@ -178,6 +178,9 @@ var schemaMigrations = []migration{
|
||||
{version: 53, name: "user_login_logs", checksum: "sha256:user-login-logs-v53", apply: func(tx *gorm.DB) error {
|
||||
return tx.AutoMigrate(&model.LoginLog{})
|
||||
}},
|
||||
{version: 54, name: "workbench_tools_and_presets", checksum: "sha256:workbench-tools-presets-v54-20261014", apply: func(tx *gorm.DB) error {
|
||||
return tx.AutoMigrate(&model.WorkbenchTool{}, &model.WorkbenchPreset{}, &model.Task{})
|
||||
}},
|
||||
}
|
||||
|
||||
func migratePrefixedIDSequenceReconcile(tx *gorm.DB) error {
|
||||
|
||||
@@ -39,6 +39,15 @@ func TestMigrateSchemaRecordsAndValidatesVersion(t *testing.T) {
|
||||
if !db.Migrator().HasTable(&model.UploadReservation{}) {
|
||||
t.Fatal("upload reservation migration missing")
|
||||
}
|
||||
if !db.Migrator().HasTable(&model.WorkbenchTool{}) || !db.Migrator().HasTable(&model.WorkbenchPreset{}) {
|
||||
t.Fatal("schema migration v54 did not create workbench tool and preset tables")
|
||||
}
|
||||
if !db.Migrator().HasIndex(&model.WorkbenchTool{}, "idx_workbench_tools_kind_enabled_sort") {
|
||||
t.Fatal("schema migration v54 did not create the workbench catalog index")
|
||||
}
|
||||
if !db.Migrator().HasIndex(&model.WorkbenchPreset{}, "idx_workbench_presets_tool_enabled_sort") {
|
||||
t.Fatal("schema migration v54 did not create the workbench preset index")
|
||||
}
|
||||
if !db.Migrator().HasIndex(&schemaMigration{}, "idx_schema_migrations_applied_at") {
|
||||
t.Fatal("schema migration v2 did not create the applied_at index")
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ func Models() []any {
|
||||
&model.CanvasSnapshot{},
|
||||
&model.CanvasSnapshotResource{},
|
||||
&model.CanvasMutationReceipt{},
|
||||
&model.WorkbenchTool{},
|
||||
&model.WorkbenchPreset{},
|
||||
&model.CanvasShare{},
|
||||
&model.PromptTemplate{},
|
||||
&model.UserPromptCustomization{},
|
||||
|
||||
Reference in New Issue
Block a user