-- 添加白名单和积分字段到sys_user表 (PostgreSQL兼容写法)
ALTER TABLE sys_user ADD COLUMN IF NOT EXISTS is_whitelisted BOOLEAN DEFAULT FALSE;
ALTER TABLE sys_user ADD COLUMN IF NOT EXISTS points BIGINT DEFAULT 0;
ALTER TABLE sys_user ADD COLUMN IF NOT EXISTS points_updated_at TIMESTAMP NULL;
ALTER TABLE sys_user ADD COLUMN IF NOT EXISTS points_updated_by BIGINT NULL;

-- 添加注释 (PostgreSQL方式)
COMMENT ON COLUMN sys_user.is_whitelisted IS '是否在白名单';
COMMENT ON COLUMN sys_user.points IS '用户积分';
COMMENT ON COLUMN sys_user.points_updated_at IS '积分最后更新时间';
COMMENT ON COLUMN sys_user.points_updated_by IS '积分最后更新人';