📝Docs: 编写数据库初始化脚本

This commit is contained in:
2025-10-17 22:59:29 +08:00
parent c395909d43
commit 98785fc421
2 changed files with 46 additions and 1 deletions
+10 -1
View File
@@ -25,4 +25,13 @@
### 博客模块
1. 获取博客
2. 获取博客列表
2. 获取博客列表
## QA
1. 如何从数据库层面杜绝重复数据出现?
答:对于 `thumb` 表,使用联合唯一索引
```mysql
CREATE UNIQUE INDEX idx_userId_blogId ON thumb (userId, blogId);
```