ALTER TABLE user_cp_gift_event_consumption
  ADD COLUMN gift_value BIGINT NOT NULL DEFAULT 0 COMMENT '本次送礼对 CP 关系贡献的积分' AFTER skip_reason,
  ADD COLUMN occurred_at_ms BIGINT NOT NULL DEFAULT 0 COMMENT 'room outbox 事件发生时间，UTC epoch ms' AFTER gift_value;

CREATE INDEX idx_user_cp_gift_consumption_weekly_rank
  ON user_cp_gift_event_consumption (app_code, status, occurred_at_ms, relationship_id);
