11 lines
406 B
MySQL
11 lines
406 B
MySQL
|
|
-- Workflow resource role V2 prerequisite.
|
||
|
|
-- Resolve any rows returned by this query before applying the unique constraint.
|
||
|
|
select robot_id, device_id, count(*) as duplicate_count
|
||
|
|
from inspection_robot_device
|
||
|
|
group by robot_id, device_id
|
||
|
|
having count(*) > 1;
|
||
|
|
|
||
|
|
alter table inspection_robot_device
|
||
|
|
drop index idx_robot_device_identity,
|
||
|
|
add unique key uk_robot_device_identity (robot_id, device_id);
|