DROP TABLE IF EXISTS `site_plugin_newsletters_groups`;
CREATE TABLE `site_plugin_newsletters_groups` (
  `group_id` int(11) NOT NULL AUTO_INCREMENT,
  `group_name` varchar(255) NOT NULL,
  `group_date` int(11) NOT NULL,
  `group_contacts` int(11) NOT NULL,
  `group_system` int(11) NOT NULL,
  `group_code` varchar(32) NOT NULL,
  `group_mc_status` int(1) NOT NULL,
  `group_mc_apikey` varchar(100) NOT NULL,
  `group_mc_listid` varchar(100) NOT NULL,
  PRIMARY KEY (`group_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


DROP TABLE IF EXISTS `site_plugin_newsletters_subscribers`;
CREATE TABLE `site_plugin_newsletters_subscribers` (
  `item_id` int(11) NOT NULL AUTO_INCREMENT,
  `item_list` text NOT NULL,
  `item_name` varchar(255) NOT NULL,
  `item_first_name` varchar(50) NOT NULL,
  `item_last_name` varchar(50) NOT NULL,
  `item_email` varchar(255) NOT NULL,
  `item_key` varchar(32) NOT NULL,
  `item_date` int(11) NOT NULL,
  `item_confirm` int(1) NOT NULL,
  `item_status` int(1) NOT NULL,
  `item_stats_date` int(11) NOT NULL,
  `item_stats_ip` varchar(30) NOT NULL,
  `item_stats_confirm_date` int(11) NOT NULL,
  `item_stats_confirm_ip` varchar(30) NOT NULL,
  `item_confirm_resend_date` int(11) NOT NULL,
  `log_ip` varchar(50) NOT NULL,
  `log_domain` varchar(255) NOT NULL,
  `log_agent` varchar(255) NOT NULL,
  PRIMARY KEY (`item_id`),
  KEY `item_email` (`item_email`),
  FULLTEXT KEY `item_list` (`item_list`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO  `site_plugin_newsletters_groups` (`group_id` ,`group_name` ,`group_date` ,`group_contacts` ,`group_system` ,`group_code`)VALUES (NULL ,  'Default',  UNIX_TIMESTAMP(),  '',  '1',  'default');
ALTER TABLE `site_plugin_newsletters_subscribers` ADD  `log_referer` varchar(255) NOT NULL;
ALTER TABLE `site_plugin_newsletters_groups` ADD  `group_mc_confirm` INT(1) NOT NULL AFTER `group_mc_status`;
ALTER TABLE `site_plugin_newsletters_groups` ADD  `group_mail_subscribe` VARCHAR(100) NOT NULL ;
ALTER TABLE `site_plugin_newsletters_groups` ADD  `group_mail_subscribed` VARCHAR(100) NOT NULL ;
