---
--- Update sql for MailWizz EMA from version 1.3.2 to 1.3.3
---

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='';

SET time_zone = "+00:00";
SET NAMES "utf8";
-- --------------------------------------------------------

ALTER TABLE `list_default` ADD `from_email` VARCHAR(100) NOT NULL AFTER `from_name` ;
UPDATE `list_default` SET `from_email` = `reply_to`;

ALTER TABLE `campaign` ADD `from_email` VARCHAR(100) NOT NULL AFTER `from_name`;
UPDATE `campaign` SET `from_email` = `reply_to`;

ALTER TABLE `delivery_server` ADD `custom_from_header` ENUM('no','yes') NOT NULL DEFAULT 'no' AFTER `hourly_sent` ;

ALTER TABLE `campaign_template` ADD `plain_text` TEXT NULL DEFAULT NULL AFTER `inline_css` ;
ALTER TABLE `campaign_template` ADD `auto_plain_text` ENUM('yes','no') NOT NULL DEFAULT 'yes' AFTER `plain_text` ;

INSERT INTO `tag_registry` (`tag_id`, `tag`, `description`, `date_added`, `last_updated`) VALUES
(63, '[CAMPAIGN_FROM_EMAIL]', NULL, '2014-02-02 00:00:00', '2014-02-02 00:00:00'),
(64, '[LIST_FROM_EMAIL]', NULL, '2014-02-02 00:00:00', '2014-02-02 00:00:00');

-- --------------------------------------------------------
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;