

GRANT GRANT OPTION ON *.* TO 'user_spider'@'localhost';
GRANT GRANT OPTION ON *.* TO 'user_spider'@'%';


GRANT GRANT OPTION ON ticket_db.* TO 'user_spider'@'localhost';
GRANT GRANT OPTION ON ticket_db.* TO 'user_spider'@'%';


FLUSH PRIVILEGES;

CREATE TABLE ym_events (
  `creation_time` datetime NOT NULL,
  `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `link` bigint(20) unsigned DEFAULT NULL,
  `category` varchar(256) NOT NULL,
  `type` varchar(256) NOT NULL,
  `start_time` datetime DEFAULT NULL,
  `duration` int(10) unsigned DEFAULT '0',
  `size` int(10) unsigned DEFAULT '0',
  `node_id` int(10) unsigned DEFAULT NULL,
  `user_id` int(10) unsigned DEFAULT NULL,
  `task_id` int(10) unsigned DEFAULT NULL,
  `database_id` int(10) unsigned DEFAULT NULL,
  `command` varchar(1024) DEFAULT NULL,
  `status` varchar(256) DEFAULT NULL,
  `summary` mediumblob,
  `comment` varchar(1024) DEFAULT NULL,
  PRIMARY KEY (`event_id`,`creation_time`),
  KEY `ymevents_database` (`database_id`),
  KEY `ymevents_node` (`node_id`),
  KEY `ymevents_user` (`user_id`),
  KEY `ymevents_task` (`task_id`),
  KEY `ymevents_status` (`status`),
  KEY `ymevents_link` (`link`),
  KEY `ymevents_category` (`category`),
  KEY `ymevents_type` (`type`),
  KEY `ymevents_starttime` (`start_time`)
) ENGINE=TokuDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 `COMPRESSION`=TOKUDB_LZMA;

CREATE TABLE ym_actions (
  `creation_time` datetime NOT NULL,
  `action_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `category` varchar(256) NOT NULL,
  `type` varchar(256) NOT NULL,
  `start_time` datetime DEFAULT NULL,
  `node_list` varchar(256) DEFAULT '|',
  `mutex` varchar(256) DEFAULT NULL,
  `task_id` int(10) unsigned DEFAULT NULL,
  `database_id` int(10) unsigned DEFAULT NULL,
  `status` varchar(256) DEFAULT NULL,
  `command` blob,
  PRIMARY KEY (`action_id`),
  KEY `ymactions_database` (`database_id`)
) ENGINE=TokuDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 `COMPRESSION`=TOKUDB_LZMA;

