-- Run this ONLY if you already imported the original schema.sql before
-- WhatsApp / photo-capture / change-password features were added.
-- (Skip this file if you're doing a fresh install — schema.sql already
-- includes these columns.)

ALTER TABLE parents
    ADD COLUMN receive_whatsapp TINYINT(1) DEFAULT 1 AFTER receive_email;

ALTER TABLE attendance_log
    ADD COLUMN whatsapp_status VARCHAR(20) DEFAULT NULL AFTER email_status,
    ADD COLUMN photo VARCHAR(255) DEFAULT NULL AFTER whatsapp_status;

INSERT INTO settings (setting_key, setting_value) VALUES
('termii_whatsapp_number_id', 'PASTE_TERMII_WHATSAPP_NUMBER_ID')
ON DUPLICATE KEY UPDATE setting_key=setting_key;
