This commit is contained in:
Your Name
2026-11-09 10:02:27 +08:00
parent 0c43d54c08
commit 8466acef9f
35 changed files with 3584 additions and 111 deletions
@@ -0,0 +1,18 @@
-- Metadata-only mobile recording links. Default prefix: zyt_.
-- No audio, transcript, original filename, contact label or device filesystem path is stored.
-- Permissions intentionally reuse firstvisit.myPatient/lists in BOTH middleware and controller.
CREATE TABLE IF NOT EXISTS `zyt_mobile_recording_binding` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`admin_id` int unsigned NOT NULL,
`installation_id` char(36) CHARACTER SET ascii COLLATE ascii_bin NOT NULL COMMENT 'Random per-install UUID v4',
`recording_key` char(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL COMMENT 'SHA256 of opaque stable local identifier, not audio content',
`diagnosis_id` int unsigned NOT NULL,
`source_platform` varchar(24) NOT NULL DEFAULT 'android_bcr',
`recorded_at` bigint unsigned NOT NULL COMMENT 'UTC Unix milliseconds; zero means unknown',
`duration_ms` bigint unsigned NOT NULL DEFAULT 0,
`created_at` int unsigned NOT NULL,
`updated_at` int unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uq_actor_device_recording` (`admin_id`, `installation_id`, `recording_key`),
KEY `idx_diagnosis_recorded` (`diagnosis_id`, `recorded_at`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Phone-local recording metadata links';