ALTER TABLE `tblsms_templates_static` CHANGE COLUMN `type` `type` ENUM('estimate','invoice','post_inspection','business_review','client_referral','estimate_expiration_reminder','invoice_overdue_reminder','work_order','payment_schedule_reminder','change_order','change_order_payment_schedule_reminder','payment_confirmation','job_booking_confirmation') NULL DEFAULT NULL  AFTER `id`;

ALTER TABLE `tblsms_templates` CHANGE COLUMN `type` `type` ENUM('estimate','invoice','post_inspection','business_review','client_referral','estimate_expiration_reminder','invoice_overdue_reminder','work_order','payment_schedule_reminder','change_order','change_order_payment_schedule_reminder','payment_confirmation','job_booking_confirmation') NULL DEFAULT NULL AFTER `tenant_id`;

INSERT INTO tblsms_templates_static (type, template) 
VALUES('payment_confirmation',"{companyname} has received your payment of {payment_total} for invoice {invoice_number}. Thanks for your business {contact_firstname}.");

INSERT INTO tblsms_templates (tenant_id, type,template,created_on,updated_on )
SELECT t.id,s.type,s.template,UTC_TIMESTAMP(),UTC_TIMESTAMP()
FROM tbltenants t
JOIN tblsms_templates_static s ON 1 = 1 AND s.type ='payment_confirmation';