-- Deploy gaia:2016_08_05_add_table_statistic_device_doctor to mysql

BEGIN;

CREATE TABLE `statistic_device_doctor` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `device_id` varchar(100) NOT NULL,
  `platform` varchar(20) NOT NULL,
  `version` varchar(10) DEFAULT NULL,
  `os_version` varchar(20) DEFAULT NULL,
  `model` varchar(40) DEFAULT NULL,
  `screen` varchar(40) DEFAULT NULL,
  `channel` varchar(40) DEFAULT NULL,
  `created_time` datetime NOT NULL,
  `last_activity` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `device_id` (`device_id`,`platform`),
  KEY `IDX_PLATFORM` (`platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

COMMIT;
