erDiagram
USER {
int user_id PK "主键"
string username
string email
date created_at
}
DIARY_ENTRY {
int entry_id PK "主键"
string title
string content
date created_at
int user_id FK "外键引用用户"
}
TAG {
int tag_id PK "主键"
string name
}
DIARY_TAG {
int entry_id FK "外键引用日记"
int tag_id FK "外键引用标签"
}
USER ||--o{ DIARY_ENTRY : "拥有"
DIARY_ENTRY ||--o{ DIARY_TAG : "包含"
TAG ||--o{ DIARY_TAG : "标记"
复制内容
下载markdown文件
在线编辑