fix(server+health): 修复权限同步 + 迁移幂等性 + 缺失菜单种子数据
- sync_module_permissions 每次启动都确保 admin 拥有所有权限(修复 CRITICAL-001) - 新增迁移 m20260505_000116: 补充 11 项缺失的健康管理菜单(多租户安全) - 修复 000101: UUID 格式错误(缺少第 4 段) - 修复 000104/000106/000107: Expr::val → Expr::cust(SQL 函数不应被引号包裹) - 修复 000109: 外键创建改为 IF NOT EXISTS 模式 - 修复 000110: 表名 critical_alerts → critical_alert(匹配实际表名) - 修复 000111/000112: create_table + create_index 添加 if_not_exists() - 修复 000113: 改为 raw SQL 幂等模式,修正 FK 目标表名 patients → patient
This commit is contained in:
@@ -14,7 +14,7 @@ impl MigrationTrait for Migration {
|
||||
ColumnDef::new(Alias::new("id"))
|
||||
.uuid()
|
||||
.not_null()
|
||||
.default(Expr::val("gen_random_uuid()")),
|
||||
.default(Expr::cust("gen_random_uuid()")),
|
||||
)
|
||||
.col(ColumnDef::new(Alias::new("tenant_id")).uuid().not_null())
|
||||
.col(
|
||||
@@ -56,13 +56,13 @@ impl MigrationTrait for Migration {
|
||||
ColumnDef::new(Alias::new("created_at"))
|
||||
.timestamp_with_time_zone()
|
||||
.not_null()
|
||||
.default(Expr::val("NOW()")),
|
||||
.default(Expr::cust("NOW()")),
|
||||
)
|
||||
.col(
|
||||
ColumnDef::new(Alias::new("updated_at"))
|
||||
.timestamp_with_time_zone()
|
||||
.not_null()
|
||||
.default(Expr::val("NOW()")),
|
||||
.default(Expr::cust("NOW()")),
|
||||
)
|
||||
.col(ColumnDef::new(Alias::new("created_by")).uuid().null())
|
||||
.col(ColumnDef::new(Alias::new("updated_by")).uuid().null())
|
||||
|
||||
Reference in New Issue
Block a user