Commit Graph

2 Commits

Author SHA1 Message Date
e8eb5766cb fix(migration): 为所有 CREATE INDEX 语句添加 IF NOT EXISTS
为 5 个 RBAC 表的所有 18 个索引语句添加 IF NOT EXISTS,使迁移脚本具有幂等性:
- tb_account: 6 个索引(包括 2 个唯一索引)
- tb_role: 2 个索引
- tb_permission: 4 个索引(包括 1 个唯一索引)
- tb_account_role: 4 个索引(包括 1 个唯一索引)
- tb_role_permission: 4 个索引(包括 1 个唯一索引)

这样即使表和索引已经存在(如通过 GORM AutoMigrate 创建),
迁移脚本也能成功执行,COMMENT 语句可以正常应用。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:08:18 +08:00
f46beb2d45 docs(migration): 为 RBAC 表添加 PostgreSQL 注释
为 5 个 RBAC 核心表添加完整的表和字段注释:
- tb_account: 账号表(13 个字段)
- tb_role: 角色表(9 个字段)
- tb_permission: 权限表(13 个字段)
- tb_account_role: 账号-角色关联表(9 个字段)
- tb_role_permission: 角色-权限关联表(9 个字段)

使用 PostgreSQL COMMENT ON 语句,提供中文注释说明每个表和字段的用途。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 14:57:33 +08:00