fix(canvas): 画布 - 防止旧内容覆盖并支持版本历史恢复

This commit is contained in:
kinoko committed 2026-09-17 18:40:42 +08:00
1 parent 73a1d2bdfd
commit ba489323d7
69 files changed
+3575 -294

No files matched your search

+4 -1
View File
@@ -11,7 +11,7 @@ import (
"gorm.io/gorm"
)
const CurrentSchemaVersion int64 = 15
const CurrentSchemaVersion int64 = 16
const baselineSchemaChecksum = "sha256:open-ai-canvas-schema-v1-20260830"
const schemaMigrationAppliedAtIndexChecksum = "sha256:schema-migrations-applied-at-index-v2-20260830"
@@ -67,6 +67,9 @@ var schemaMigrations = []migration{
{version: 15, name: "agent_profiles", checksum: "sha256:agent-profiles-v15-20260914", apply: func(tx *gorm.DB) error {
return tx.AutoMigrate(&model.AgentProfile{})
}},
{version: 16, name: "canvas_revision_history", checksum: "sha256:canvas-revision-history-v16", apply: func(tx *gorm.DB) error {
return tx.AutoMigrate(&model.CanvasProject{}, &model.CanvasSnapshot{}, &model.CanvasSnapshotResource{})
}},
}
func migrateSchemaV14(tx *gorm.DB) error {