DROP TABLE IF EXISTS `site_plugin_comments`;
CREATE TABLE `site_plugin_comments` (
  `comment_id` int(11) NOT NULL AUTO_INCREMENT,
  `module_id` varchar(30) NOT NULL,
  `lang_id` int(3) NOT NULL,
  `comment_parent` int(11) NOT NULL,
  `comment_code` varchar(32) NOT NULL,
  `comment_url` varchar(500) NOT NULL,
  `comment_url_code` varchar(32) NOT NULL,
  `comment_url_vars` TEXT NOT NULL,
  `comment_date` int(11) NOT NULL,
  `comment_author` varchar(50) NOT NULL,
  `comment_website` varchar(255) NOT NULL,
  `comment_email` varchar(50) NOT NULL,
  `comment_body` text NOT NULL,
  `comment_status` int(1) NOT NULL,
  `comment_user` int(11) NOT NULL,
  `comment_reserved` int(11) NOT NULL,
  `comment_avatar` varchar(255) NOT NULL,
  `comment_log_ip` varchar(30) NOT NULL,
  `log_ip` varchar(50) NOT NULL,
  `log_domain` varchar(255) NOT NULL,
  `log_agent` varchar(255) NOT NULL,
  PRIMARY KEY (`comment_id`),
  KEY `comment_url` (`comment_url`(255)),
  KEY `comment_date` (`comment_date`),
  KEY `comment_status` (`comment_status`),
  KEY `module_id` (`module_id`,`lang_id`,`comment_parent`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `site_plugin_comments_types`;
CREATE TABLE `site_plugin_comments_types` (
  `type_id` int(11) NOT NULL AUTO_INCREMENT,
  `type_name` varchar(255) NOT NULL,
  PRIMARY KEY (`type_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `site_plugin_comments_types` (`type_id`, `type_name`) VALUES
(1, 'Local'),
(2, 'Facebook'),
(3, 'DISQUS');
