-- Deploy gaia:2019-12-31_add_like_promotioninfo_table to mysql

BEGIN;

CREATE TABLE `like_promotion_channel` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `app_name` varchar(64) NOT NULL,
  `appid` varchar(64) NOT NULL,
  `device_id` varchar(64) NOT NULL,
  `idfa` varchar(64) NOT NULL,
  `idfv` varchar(64) NOT NULL,
  `udid` varchar(64) NOT NULL,
  `uuid` varchar(64) NOT NULL,
  `imei` varchar(64) NOT NULL,
  `mac` varchar(100) DEFAULT NULL,
  `platform` varchar(100) NOT NULL,
  `model` varchar(40) DEFAULT NULL,
  `client_type` int(11) NOT NULL,
  `callback_type` varchar(2) NOT NULL,
  `callback` varchar(1024) NOT NULL,
  `request` longtext NOT NULL,
  `response` longtext NOT NULL,
  `active_key` varchar(1024) NOT NULL,
  `record_from` varchar(128) NOT NULL,
  `version` varchar(10) DEFAULT NULL,
  `os_version` varchar(20) DEFAULT NULL,
  `screen` varchar(40) DEFAULT NULL,
  `create_time` datetime(6) NOT NULL,
  `active_time` datetime(6) DEFAULT NULL,
  `last_activity` datetime(6) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `like_promotion_channel_device_id_appid_idfa_idf_7240e26c_uniq` (`device_id`,`appid`,`idfa`,`idfv`,`imei`)
) ENGINE=InnoDB AUTO_INCREMENT=1590063 DEFAULT CHARSET=utf8;

CREATE TABLE `like_promotioninfo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(128) NOT NULL,
  `code` varchar(64) NOT NULL,
  `sub_code` varchar(128) NOT NULL,
  `platform` varchar(8) NOT NULL,
  `appendtime` date NOT NULL,
  `app` varchar(8) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1489 DEFAULT CHARSET=utf8;

COMMIT;
