CREATE TABLE `ohrm_notification_subscriber_subscription_template` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `notification_id` int(11) NOT NULL,
  `media_id` int(11) DEFAULT NULL,
  `locale` varchar(20) DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `body` text,
   PRIMARY KEY (id),
   CONSTRAINT `ohrm_notification_subscriber_subscription_template_ibfk_1` FOREIGN KEY (`notification_id`)
    REFERENCES `ohrm_notification` (`id`)
    ON DELETE CASCADE
    ON UPDATE CASCADE,
   CONSTRAINT `ohrm_notification_subscriber_subscription_template_ibfk_2` FOREIGN KEY (`media_id`)
    REFERENCES `ohrm_notification_media` (`id`)
    ON DELETE CASCADE
    ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `ohrm_notification_subscriber_subscription` ADD `template_id` int(11) DEFAULT NULL;
ALTER TABLE `ohrm_notification_subscriber_subscription`
  ADD CONSTRAINT `ohrm_notification_subscriber_subscription_ibfk_3` FOREIGN KEY (`template_id`) REFERENCES `ohrm_notification_subscriber_subscription_template` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

UPDATE `ohrm_menu_item` SET `menu_title`='Email Notifications' WHERE `menu_title`='Email Subscriptions';
UPDATE `ohrm_menu_item` SET `status` = 1 WHERE `menu_title`='Email Notifications';