-- يحذف بيانات التشغيل فقط للحساب رقم 1، ولا يحذف الحساب أو المستخدمين أو الإعدادات.
SET FOREIGN_KEY_CHECKS=0;
DELETE FROM atlas_goal_project_links WHERE goal_id IN (SELECT id FROM atlas_goals WHERE account_id = 1);
DELETE ci FROM atlas_checklist_items ci JOIN atlas_tasks t ON t.id = ci.task_id WHERE t.account_id = 1;
DELETE FROM atlas_tasks WHERE account_id = 1;
DELETE FROM atlas_modules WHERE account_id = 1;
DELETE FROM atlas_projects WHERE account_id = 1;
DELETE FROM atlas_goals WHERE account_id = 1;
DELETE FROM atlas_todo_items WHERE account_id = 1;
DELETE FROM atlas_calendar_events WHERE account_id = 1;
DELETE FROM atlas_documents WHERE account_id = 1;
DELETE FROM atlas_ideas WHERE account_id = 1;
DELETE FROM atlas_notifications WHERE account_id = 1;
DELETE FROM atlas_resume_points WHERE account_id = 1;
DELETE FROM atlas_workspaces WHERE account_id = 1;
DELETE FROM atlas_activity_logs WHERE account_id = 1;
SET FOREIGN_KEY_CHECKS=1;
INSERT INTO atlas_data_resets (account_id, user_id, reset_type, notes, created_at) VALUES (1, 1, 'operational_data', 'Manual SQL reset', NOW());
