feat(channels): 渠道管理 - 可视化排序与别名并修复注册及外观清理 (#444)

This commit is contained in:
Ray authored and GitHub committed 2026-09-08 20:56:42 +08:00
1 parent 381edf37e3
commit 8360b2c933
41 files changed
+1485 -148

No files matched your search

+16 -1
View File
@@ -10,7 +10,7 @@ import (
"gorm.io/gorm"
)
const CurrentSchemaVersion int64 = 8
const CurrentSchemaVersion int64 = 9
const baselineSchemaChecksum = "sha256:open-ai-canvas-schema-v1-20260830"
const schemaMigrationAppliedAtIndexChecksum = "sha256:schema-migrations-applied-at-index-v2-20260830"
@@ -54,6 +54,21 @@ var schemaMigrations = []migration{
{version: 6, name: "resource_playback_variant", checksum: resourcePlaybackChecksum, apply: migrateSchemaV6},
{version: 7, name: "asset_library_folders", checksum: assetLibraryFoldersChecksum, apply: migrateSchemaV7},
{version: 8, name: "logical_model_active_code", checksum: logicalModelActiveCodeChecksum, apply: migrateSchemaV8},
{version: 9, name: "channel_presentation", checksum: "sha256:channel-presentation-v9-20260908", apply: migrateChannelPresentation},
}
func migrateChannelPresentation(tx *gorm.DB) error {
for _, column := range []struct {
model any
field string
}{{&model.ModelChannel{}, "PublicAlias"}, {&model.ModelChannel{}, "SortOrder"}, {&model.ChannelModel{}, "SortOrder"}} {
if !tx.Migrator().HasColumn(column.model, column.field) {
if err := tx.Migrator().AddColumn(column.model, column.field); err != nil {
return err
}
}
}
return nil
}
func migrationsForDatabase(db *gorm.DB) ([]migration, error) {