ALTER TABLE tblpayments_categories
ADD COLUMN added_by   BIGINT(20) UNSIGNED DEFAULT NULL,
ADD COLUMN updated_by BIGINT(20) UNSIGNED DEFAULT NULL,
ADD COLUMN added_on   DATETIME            DEFAULT NULL,
ADD COLUMN updated_on DATETIME            DEFAULT NULL;


UPDATE tblpayments_categories cat
JOIN tblstaff staff ON staff.tenant_id = cat.tenant_id AND staff.is_tenant = 1
SET cat.updated_by = staff.staffid,cat.added_by = staff.staffid,cat.added_on = CURRENT_TIMESTAMP,cat.updated_on = CURRENT_TIMESTAMP
where 1=1;
