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

15 lines
793 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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';