-- demo_cleanup.sql — Remove all demo data (MCU ID=9999)
-- Usage: mysql -u admin -pSasone!102938 cpone_dashboard < demo_cleanup.sql

SET FOREIGN_KEY_CHECKS = 0;

DELETE FROM mcu_station_progress      WHERE Mcu_StationProgressMcuID = 9999;
DELETE FROM mcu_checkinout            WHERE Mcu_CheckinoutMcuID = 9999;
DELETE FROM mcu_patient_required_station WHERE mcu_id = 9999;
DELETE FROM mcu_patient_schedule      WHERE Mcu_PatientSchedulePreregisterID BETWEEN 900001 AND 901500;
DELETE FROM mcu_patient_resume_status WHERE Mcu_PatientResumeStatusMcuID = 9999;
DELETE FROM published_mcu_dashboard_sync WHERE Published_McuDasboardT_OrderHeaderID BETWEEN 900001 AND 901500;
DELETE FROM kelainan_details          WHERE Mgm_McuID = 9999;
DELETE FROM mcu_participant_daily     WHERE Mcu_ParticipantDailyMcuID = 9999;
DELETE FROM mcu_patient               WHERE Mcu_PatientMcuID = 9999;
DELETE FROM mcu_project               WHERE Mcu_ProjectMcuID = 9999;

SET FOREIGN_KEY_CHECKS = 1;

SELECT 'Demo data removed.' AS status;
