USE provisioning; ALTER TABLE voip_fielddev_preferences drop constraint `v_fd_p_deviceid_ref`; ALTER TABLE voip_fielddev_preferences ADD CONSTRAINT `v_fd_p_fielddeviceid_ref` FOREIGN KEY (`device_id`) REFERENCES `autoprov_field_devices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;