-- Heatmap raw material: normalized (0..1) spatial point per event, and the four new -- event types (occupancy rules + near-miss). The chk_events_type constraint would REJECT -- lone_worker/overcapacity/overstay/near_fall inserts on MySQL 8.0.16+ without this. 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' ));