15 lines
793 B
MySQL
15 lines
793 B
MySQL
|
|
CREATE TABLE IF NOT EXISTS notification_event (
|
|||
|
|
event_id uuid PRIMARY KEY, -- 事件 ID
|
|||
|
|
|
|||
|
|
event_type text, -- POST_PUBLISHED / COMMENT_ADDED / MENTIONED ...
|
|||
|
|
actor_uid text, -- 觸發者 UID(例如 A)
|
|||
|
|
object_type text, -- POST / COMMENT / USER ...
|
|||
|
|
object_id text, -- 對應物件 ID(post_id 等)
|
|||
|
|
|
|||
|
|
title text, -- 顯示用標題
|
|||
|
|
body text, -- 顯示用內容 / 摘要
|
|||
|
|
payload text, -- JSON string(額外欄位,例如 {"postId": "..."})
|
|||
|
|
|
|||
|
|
priority smallint, -- 1=critical, 2=high, 3=normal, 4=low
|
|||
|
|
created_at timestamp -- 事件時間(方便做 cross table 查詢)
|
|||
|
|
) AND comment = 'notification_event';
|