ALTER TABLE `ohrm_notification_subscriber_subscription_template` ADD `type` tinyint(1) DEFAULT NULL;
ALTER TABLE `ohrm_notification_subscriber_subscription_template` ADD `prev_id` int(11) DEFAULT NULL;

INSERT INTO `ohrm_notification_subscriber_subscription_template` (`notification_id`,`name`,`media_id`,`locale`,`subject`,`body`, `type`, `prev_id`)
SELECT nt.notification_id, CONCAT_WS('-',n.name, CONCAT('Recipient:', nt.recipient_role)), nt.media_id, nt.locale, nt.subject, nt.body, 0, nt.id
FROM ohrm_notification_template nt
LEFT JOIN ohrm_notification n on n.id = nt.notification_id;

INSERT INTO `ohrm_notification_subscriber_subscription_template` (`notification_id`,`name`,`media_id`,`locale`,`subject`,`body`, `type`, `prev_id`)
SELECT ns.notification_id, CONCAT_WS('-',n.name, CONCAT('Recipient:', st.recipient_role)), st.media_id, st.locale, st.subject, st.body, 1, st.id
FROM ohrm_notification_subscription_template st
LEFT JOIN `ohrm_notification_subscription` ns ON ns.id = st.subscription_id
LEFT JOIN ohrm_notification n on n.id = ns.notification_id;