-- Deploy gaia:record_union_open_relation to mysql

BEGIN;

-- XXX Add DDLs here.
CREATE TABLE `api_wechat_account_relation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `is_online` tinyint(1) NOT NULL,
  `create_time` datetime(6) NOT NULL,
  `update_time` datetime(6) NOT NULL,
  `is_deleted` tinyint(1) NOT NULL,
  `user_id` int(11) NOT NULL,
  `wechat_platform_type` smallint(60) NOT NULL,
  `unionid` varchar(60) NOT NULL,
  `openid` varchar(60) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `awar_user_platform` (`user_id`,`wechat_platform_type`),
  KEY `awar_update_time` (`update_time`),
  KEY `awar_open_id` (`openid`),
  KEY `awar_union_id` (`unionid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


COMMIT;
