begin;

CREATE TABLE `t_avatar` (
  `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
  `token_id` varchar(60) COMMENT 'token_id',
  `item_id` int(11) NOT NULL COMMENT 'item_id',
  `item_type` int(11) NOT NULL  COMMENT 'item类型',
  `status` int(11) NOT NULL DEFAULT '0'  COMMENT '装备状态',
  `hero_idx` bigint DEFAULT NULL COMMENT '英雄外键id',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `hero_idx_type` (`hero_idx`, `item_type`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

insert into version (version) values(2023092001);

commit;
