-- Füge fehlende Worklog-Einträge für Mittwoch, 15.10.2025 hinzu
-- Lokale Zeit (MESZ = UTC+2): 08:43:02, 12:12:04, 13:33:20, 17:53:06
-- UTC-Zeit (für DB): 06:43:02, 10:12:04, 11:33:20, 15:53:06

-- Variablen für die IDs (werden nach dem INSERT gesetzt)
SET @start_work_id = NULL;
SET @start_pause_id = NULL;

-- 1. start work (keine relatedTo_id)
INSERT INTO worklog (user_id, state, tstamp, relatedTo_id, version) 
VALUES (1, 'start work', '2025-10-15 06:43:02', NULL, 0);
SET @start_work_id = LAST_INSERT_ID();

-- 2. start pause (relatedTo_id = start work)
INSERT INTO worklog (user_id, state, tstamp, relatedTo_id, version) 
VALUES (1, 'start pause', '2025-10-15 10:12:04', @start_work_id, 0);
SET @start_pause_id = LAST_INSERT_ID();

-- 3. stop pause (relatedTo_id = start pause)
INSERT INTO worklog (user_id, state, tstamp, relatedTo_id, version) 
VALUES (1, 'stop pause', '2025-10-15 11:33:20', @start_pause_id, 0);

-- 4. stop work (relatedTo_id = start work)
INSERT INTO worklog (user_id, state, tstamp, relatedTo_id, version) 
VALUES (1, 'stop work', '2025-10-15 15:53:06', @start_work_id, 0);

SELECT 'Worklog-Einträge für 15.10.2025 erfolgreich eingefügt' AS Status;

