-- 表名 user_whole
DROP TABLE IF EXISTS gghb.origin_user_whole;
CREATE TABLE gghb.origin_user_whole (
  user_id VARCHAR(32) NOT NULL PRIMARY KEY COMMENT "用户ID",
  create_time INT DEFAULT NULL COMMENT "创建时间",
  sex VARCHAR(32) DEFAULT NULL COMMENT "性别",
  date_of_birth VARCHAR(32) DEFAULT NULL COMMENT "生日",
  country VARCHAR(32) DEFAULT NULL COMMENT "地域 - VN:越南，MY:马来西亚，TH:泰国，PH：菲律宾，ID:印度尼西亚",
  device VARCHAR(32) DEFAULT NULL COMMENT "机型",
  INDEX (user_id),
  INDEX (create_time),
  INDEX (sex),
  INDEX (date_of_birth),
  INDEX (country),
  INDEX (device)
) COMMENT "用户基础数据";

-- 表名 account_flow_record
DROP TABLE IF EXISTS gghb.origin_account_flow_record;
CREATE TABLE gghb.origin_account_flow_record (
  user_id VARCHAR(32) DEFAULT NULL COMMENT "用户ID",
  diamonds INT DEFAULT NULL COMMENT "金额：钻石数量",
  create_time datetime DEFAULT NULL COMMENT "时间",
  INDEX (user_id),
  INDEX (diamonds),
  INDEX (create_time)
) COMMENT "用户付费流水";

-- 表名 chat
DROP TABLE IF EXISTS gghb.origin_chat;
CREATE TABLE gghb.origin_chat (
  user_a_id VARCHAR(32) DEFAULT NULL COMMENT "用户A的ID",
  user_b_id VARCHAR(32) DEFAULT NULL COMMENT "用户B的ID",
  chat_count INT DEFAULT NULL COMMENT "条数",
  create_time INT DEFAULT NULL COMMENT "发起时间戳",
  INDEX (user_a_id),
  INDEX (user_b_id),
  INDEX (chat_count),
  INDEX (create_time)
) COMMENT "聊天数据";

-- 表名 consume_diamonds
DROP TABLE IF EXISTS gghb.origin_consume_diamonds;
CREATE TABLE gghb.origin_consume_diamonds (
  user_id VARCHAR(32) DEFAULT NULL COMMENT "用户ID",
  action VARCHAR(32) DEFAULT NULL COMMENT "消费动作",
  amount INT DEFAULT NULL COMMENT "消费金额",
  create_time datetime DEFAULT NULL COMMENT "消费时间",
  INDEX (user_id),
  INDEX (action),
  INDEX (amount),
  INDEX (create_time)
) COMMENT "用户消费数据";

-- 表名 feed
DROP TABLE IF EXISTS gghb.origin_feed;
CREATE TABLE gghb.origin_feed (
  user_id VARCHAR(32) DEFAULT NULL COMMENT "发起者",
  create_time INT DEFAULT NULL COMMENT "发起时间",
  feed_id VARCHAR(32) DEFAULT NULL COMMENT "feedId",
  INDEX (user_id),
  INDEX (create_time),
  INDEX (feed_id)
) COMMENT "用户feed数据";

-- 表名 follow
DROP TABLE IF EXISTS gghb.origin_follow;
CREATE TABLE gghb.origin_follow (
  user_a_id VARCHAR(32) DEFAULT NULL COMMENT "用户A的ID",
  user_b_id VARCHAR(32) DEFAULT NULL COMMENT "用户B的ID",
  create_time INT DEFAULT NULL COMMENT "时间戳",
  INDEX (user_a_id),
  INDEX (user_b_id),
  INDEX (create_time)
) COMMENT "用户关注数据";

-- 表名 match
DROP TABLE IF EXISTS gghb.origin_match;
CREATE TABLE gghb.origin_match (
  user_a_id VARCHAR(32) DEFAULT NULL COMMENT "用户A的ID",
  user_b_id VARCHAR(32) DEFAULT NULL COMMENT "用户B的ID",
  type VARCHAR(32) DEFAULT NULL COMMENT "互动类型",
  create_time INT DEFAULT NULL COMMENT "match的时间戳",
  like_other VARCHAR(32) DEFAULT NULL COMMENT "给对方比心",
  other_like VARCHAR(32) DEFAULT NULL COMMENT "被对方比心",
  chat_count INT DEFAULT NULL COMMENT "消息聊天总数（voice的聊天总数都是0）",
  INDEX (user_a_id),
  INDEX (user_b_id),
  INDEX (type),
  INDEX (create_time),
  INDEX (like_other),
  INDEX (other_like),
  INDEX (chat_count)
) COMMENT "用户匹配数据";

-- 表名 user_action
DROP TABLE IF EXISTS gghb.origin_user_action;
CREATE TABLE gghb.origin_user_action (
  user_id VARCHAR(32) DEFAULT NULL COMMENT "用户ID",
  create_time datetime DEFAULT NULL COMMENT "时间",
  INDEX (user_id),
  INDEX (create_time)
) COMMENT "用户行为数据";
