迁移:将DB变更记录SQL文件移动到sql目录下

This commit is contained in:
2026-01-13 10:05:32 +08:00
parent cb268fe26d
commit ebd2e8aa75
131 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
-- 更新 cli_surgery 表的 tenant_id 字段
-- 创建时间: 2025-01-04
-- 说明: 为已存在的手术记录设置默认租户ID
-- 将所有 tenant_id 为 NULL 的记录设置为默认租户ID1
UPDATE cli_surgery
SET tenant_id = 1
WHERE tenant_id IS NULL;
-- 添加非空约束(可选,根据业务需求决定是否执行)
-- ALTER TABLE cli_surgery ALTER COLUMN tenant_id SET NOT NULL;
-- ALTER TABLE cli_surgery ALTER COLUMN tenant_id SET DEFAULT 1;