- Created `sag_recent_cases` table to persist recently opened cases per user for quick access in the bottom bar. - Added pause/resume support in `tmodule_times` by introducing `paused_at` and `pause_total_seconds` columns. - Established `user_notes` table for personal user notes with indexing for active and updated notes, along with a trigger to update the `updated_at` timestamp on modifications. Co-authored-by: Copilot <copilot@github.com>
14 lines
536 B
SQL
14 lines
536 B
SQL
-- Migration 179: Add pause/resume support for live timers
|
|
-- Date: 2026-04-23
|
|
|
|
ALTER TABLE tmodule_times
|
|
ADD COLUMN IF NOT EXISTS paused_at TIMESTAMP,
|
|
ADD COLUMN IF NOT EXISTS pause_total_seconds INTEGER NOT NULL DEFAULT 0;
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tmodule_times_active_unfinished
|
|
ON tmodule_times (medarbejder_id, aktiv_timer, slut_tid);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tmodule_times_paused_unfinished
|
|
ON tmodule_times (medarbejder_id, paused_at, slut_tid)
|
|
WHERE paused_at IS NOT NULL AND slut_tid IS NULL;
|