hyapp-server/scripts/mysql/044_game_explore_winners.sql
2026-06-11 17:11:59 +08:00

17 lines
1.1 KiB
SQL
Raw 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 game_explore_winners (
app_code VARCHAR(32) NOT NULL COMMENT '应用编码,用于多租户隔离',
win_id VARCHAR(96) NOT NULL COMMENT 'Explore Square 播报 ID',
game_code VARCHAR(64) NOT NULL COMMENT 'App H5 入口 key例如 game_dice/game_rock',
game_id VARCHAR(96) NOT NULL COMMENT '来源游戏 ID',
user_id BIGINT NOT NULL COMMENT '获胜用户 ID',
display_name VARCHAR(128) NOT NULL DEFAULT '' COMMENT '展示昵称快照',
avatar_url VARCHAR(512) NOT NULL DEFAULT '' COMMENT '展示头像快照',
coin_amount BIGINT NOT NULL COMMENT '获胜金币数',
won_at_ms BIGINT NOT NULL COMMENT '获胜时间UTC epoch ms',
created_at_ms BIGINT NOT NULL COMMENT '创建时间UTC epoch ms',
updated_at_ms BIGINT NOT NULL COMMENT '更新时间UTC epoch ms',
PRIMARY KEY(app_code, win_id),
KEY idx_game_explore_winners_time(app_code, won_at_ms, win_id),
KEY idx_game_explore_winners_game(app_code, game_code, won_at_ms)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Explore Square 游戏获胜播报表';