-- 创建通知表
CREATE TABLE T_Notification (
    F_ID INT IDENTITY(1,1) PRIMARY KEY,
    F_Type NVARCHAR(50) NOT NULL, -- 通知类型：like, comment, reply
    F_SenderID NVARCHAR(50), -- 发送者ID
    F_SenderName NVARCHAR(100) NOT NULL, -- 发送者名称
    F_ReceiverID NVARCHAR(50), -- 接收者ID
    F_ReceiverName NVARCHAR(100) NOT NULL, -- 接收者名称
    F_WorkId NVARCHAR(50) NOT NULL, -- 工作圈动态ID
    F_WorkType NVARCHAR(50) NOT NULL, -- 工作圈类型：workcicle, personcicle
    F_Content NVARCHAR(500), -- 通知内容（评论内容）
    F_IsRead BIT DEFAULT 0, -- 是否已读
    F_CreateTime DATETIME DEFAULT GETDATE() -- 创建时间
);

-- 创建索引
CREATE INDEX IX_Notification_Receiver ON T_Notification(F_ReceiverName);
CREATE INDEX IX_Notification_WorkId ON T_Notification(F_WorkId);
CREATE INDEX IX_Notification_CreateTime ON T_Notification(F_CreateTime);

-- 插入测试数据
INSERT INTO T_Notification (F_Type, F_SenderName, F_ReceiverName, F_WorkId, F_WorkType, F_Content, F_IsRead)
VALUES 
('like', '张三', '李四', '1', 'workcicle', NULL, 0),
('comment', '王五', '李四', '1', 'workcicle', '这个动态很棒！', 0),
('like', '赵六', '李四', '2', 'personcicle', NULL, 1);
