ALTER TABLE `m3_customer_support_packages` CHANGE `term_str` `term_str` ENUM( 'Year', 'Month', 'Week', 'Day', 'Hour', 'Never' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;


CREATE TABLE `m3_user_bounce_list` (
`id` BIGINT( 22 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`user_id` BIGINT( 22 ) NOT NULL ,
`subject` TEXT NOT NULL ,
`body` TEXT NOT NULL ,
`created` INT NOT NULL
) ENGINE = MYISAM  DEFAULT CHARSET=utf8  ;

ALTER TABLE  `m3_helpdesk_tickets` ADD  `last_reply` INT( 11 ) NOT NULL AFTER  `status`;

update m3_helpdesk_tickets set last_reply=(select created from m3_helpdesk_ticket_replies where m3_helpdesk_ticket_replies.ticket_id=m3_helpdesk_tickets.id order by created desc limit 0, 1);


CREATE TABLE IF NOT EXISTS `m3_media_download_logs` (
  `id` bigint(22) unsigned NOT NULL AUTO_INCREMENT,
  `customer_id` bigint(22) NOT NULL,
  `user_id` bigint(22) NOT NULL,
  `file_id` varchar(32) NOT NULL,
  `name` varchar(255) NOT NULL,
  `filename` varchar(255) NOT NULL,
  `ip` varchar(255) NOT NULL,
  `created` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS `m3_license_blacklist` (
  `license_key` varchar(255) NOT NULL,
  `created` int(11) NOT NULL,
  UNIQUE KEY `license_key` (`license_key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


ALTER TABLE `m3_packages` CHANGE `package_type` `package_type` ENUM( 'Standard', 'VIP', 'Addon', 'Download Control' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'Standard'; 
ALTER TABLE `m3_cart_items` ADD `parent_item_id` BIGINT( 22 ) NOT NULL AFTER `package_id` ;

ALTER TABLE `m3_kb_article` ADD `enable_disqus_comments` ENUM( 'No', 'Yes' ) NOT NULL DEFAULT 'Yes' AFTER `page_views` ;

ALTER TABLE  `m3_order_parts` ADD  `parent_part_id` BIGINT( 22 ) NOT NULL AFTER  `parent_package_id`;

ALTER TABLE  `m3_product_sku` ADD  `use_units` ENUM(  'No',  'Yes' ) NOT NULL DEFAULT  'No' AFTER  `max_order`;

UPDATE `m3_menu` SET `name` = '.CMS' WHERE `m3_menu`.`id` =77;