backend/generate/database/cassandra/2025111700000001_notificati...

15 lines
793 B
MySQL
Raw Permalink Normal View History

2025-11-17 09:31:58 +00:00
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, -- 對應物件 IDpost_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';