ALTER TABLE humidities
DROP CONSTRAINT fk_humidites_sensor_id;

ALTER TABLE humidities
ADD CONSTRAINT pk_humidites_sensor_id
FOREIGN KEY (sensor_id)
REFERENCES sensors(sensor_id)
ON DELETE CASCADE
ON UPDATE CASCADE;