erDiagram
USER ||--o{ JOURNAL : owns
USER {
string user_id PK "用户ID"
string username "用户名"
string email "邮箱"
datetime created_at "创建时间"
}
JOURNAL ||--o{ ENTRY : contains
JOURNAL {
string journal_id PK "日记本ID"
string user_id FK "所属用户"
string title "日记本名称"
datetime created_at "创建时间"
}
ENTRY }o--o{ TAG : has
ENTRY {
string entry_id PK "日记ID"
string journal_id FK "所属日记本"
string title "日记标题"
text content "日记内容"
datetime created_at "创建时间"
datetime updated_at "更新时间"
}
TAG {
string tag_id PK "标签ID"
string name "标签名称"
}
复制内容
下载markdown文件
在线编辑