Files
breadcrumb-the-shire/modules/helpdesk/migrations/006_create_handover_revisions.sql
fs 03e15eaf08 feat(helpdesk): add handover revision history with timeline, diff, and restore
Every save creates an immutable revision snapshot. The aside shows a
commit-graph-style timeline (newest first) with vertical line, circle
nodes, version numbers, change type, user, and date. Clicking a past
revision renders it readonly with inline git-diff-style highlights
(changed/added/removed with tinted backgrounds). Compare mode allows
diffing any two arbitrary revisions. MANAGE users can restore old
versions, which creates a new revision preserving full history.

New: HandoverRevisionService, HandoverRevisionRepository,
migration 006, 14 PHPUnit tests, DE/EN translations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 22:14:40 +02:00

17 lines
909 B
SQL

CREATE TABLE IF NOT EXISTS `helpdesk_handover_revisions` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`tenant_id` INT UNSIGNED NOT NULL,
`handover_id` BIGINT UNSIGNED NOT NULL,
`revision` INT UNSIGNED NOT NULL,
`field_values` TEXT NULL DEFAULT NULL,
`status` VARCHAR(20) NOT NULL,
`schema_version` INT UNSIGNED NOT NULL DEFAULT 1,
`change_type` VARCHAR(20) NOT NULL DEFAULT 'fields',
`changed_by` INT UNSIGNED NOT NULL,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_hr_handover_revision` (`handover_id`, `revision`),
KEY `idx_hr_tenant_handover` (`tenant_id`, `handover_id`),
KEY `idx_hr_handover_created` (`handover_id`, `created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;