Fixe relations support by referncing the correct key
We need to reference the device primary key, not deviceid