-- Heatmap raw material: normalized (0..1) spatial point per event, and the five new -- event types (occupancy rules + near-miss + ergo report). The chk_events_type constraint -- would REJECT the new types' inserts on MySQL 8.0.16+ without this. (Never applied to any -- deployment before this revision, so the type list is edited in place.) ALTER TABLE move_events ADD COLUMN spatial_x DOUBLE NULL AFTER metrics_json, ADD COLUMN spatial_y DOUBLE NULL AFTER spatial_x; ALTER TABLE move_events DROP CHECK chk_events_type; ALTER TABLE move_events ADD CONSTRAINT chk_events_type CHECK (event_type IN ( 'fall','no_motion','immobility','ghost','zone_warning', 'zone_restricted','pinch','monitoring_degraded','device_fault', 'lone_worker','overcapacity','overstay','near_fall','ergo_report' ));