CREATE TABLE IF NOT EXISTS `logs` (

  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,

  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

  `log` text,

  `user_id` int(10) unsigned NOT NULL,

  `userip` varchar(40) DEFAULT NULL,

  `hostip` varchar(40) DEFAULT NULL,

  `username` varchar(128) NOT NULL,

  `line` longtext NOT NULL,

  PRIMARY KEY (`id`),

  KEY `user_id` (`user_id`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;