-- Add a unique constraint to ensure a device has at most one ACTIVE cooldown record at a time.
-- This helps prevent concurrent assignments of the same machine to multiple links.

ALTER TABLE machine_cooldown
  ADD UNIQUE KEY ux_machine_cooldown_active (machine_id, status);

