Some checks failed
CI Check / check (push) Has been cancelled
- 创建统一的Modal组件,采用Apple风格设计 - 实现毛玻璃效果、圆角、动画和细边框描边 - 修复弹窗打开时背景滚动问题 - 修复分类管理中重复卡片和数组字符串显示问题 - 优化选项解析逻辑,添加去重和过滤机制
21 lines
654 B
TypeScript
21 lines
654 B
TypeScript
/**
|
|
* 工具方法:确保 system_settings 表的可选列已创建
|
|
* 兼容旧版本数据库缺少 enabledBuiltinTemplates / categoryManagedFields 的情况
|
|
*/
|
|
|
|
import { prisma } from '@/lib/prisma'
|
|
|
|
async function addColumnIfMissing(column: string) {
|
|
try {
|
|
await prisma.$executeRawUnsafe(`ALTER TABLE "system_settings" ADD COLUMN IF NOT EXISTS "${column}" TEXT`)
|
|
} catch (error) {
|
|
console.error(`[SystemSettings] Failed to ensure column ${column}:`, error)
|
|
}
|
|
}
|
|
|
|
export async function ensureSystemSettingsOptionalColumns() {
|
|
await addColumnIfMissing('enabledBuiltinTemplates')
|
|
await addColumnIfMissing('categoryManagedFields')
|
|
}
|
|
|