-- 添加活动数据权限字段
-- 版本: V48
-- 描述: 为activities表添加department_id和creator_id字段用于数据权限过滤

ALTER TABLE activities ADD COLUMN department_id BIGINT DEFAULT NULL;
ALTER TABLE activities ADD COLUMN creator_id BIGINT DEFAULT NULL;
COMMENT ON COLUMN activities.department_id IS '创建者所属部门ID';
COMMENT ON COLUMN activities.creator_id IS '活动创建者ID';

-- 添加索引
CREATE INDEX idx_activities_department ON activities(department_id);
CREATE INDEX idx_activities_creator ON activities(creator_id);
