CREATE TABLE `%%%TABLE_NAME%%%` (
  `log_id` int(11) NOT NULL AUTO_INCREMENT,
  `created` datetime NOT NULL,
  `ip` varchar(18) NOT NULL,
  `id` varchar(8) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `target` varchar(8) NOT NULL,
  `target_id` int(11) DEFAULT NULL,
  `target_key` varchar(128) DEFAULT NULL,
  `action` varchar(8) NOT NULL,
  `success` tinyint(1) NOT NULL DEFAULT '1',
  `detail` mediumtext,
  PRIMARY KEY (`log_id`),
  KEY `ip` (`ip`),
  KEY `created` (`created`),
  KEY `id` (`id`),
  KEY `user_id` (`user_id`),
  KEY `target` (`target`,`target_id`),
  KEY `target_2` (`target`,`target_key`),
  KEY `target_3` (`target`,`action`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8