fix: rename postgresql constraints

This commit is contained in:
Markus Pesch 2021-01-30 16:51:21 +01:00
parent 366dccde12
commit 59db7cfc85
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982
4 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,9 @@
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;

View File

@ -0,0 +1,9 @@
ALTER TABLE humidities
DROP CONSTRAINT pk_humidites_sensor_id;
ALTER TABLE humidities
ADD CONSTRAINT fk_humidites_sensor_id
FOREIGN KEY (sensor_id)
REFERENCES sensors(sensor_id)
ON DELETE CASCADE
ON UPDATE CASCADE;

View File

@ -0,0 +1,9 @@
ALTER TABLE pressures
DROP CONSTRAINT fk_pressures_sensor_id;
ALTER TABLE pressures
ADD CONSTRAINT pk_pressures_sensor_id
FOREIGN KEY (sensor_id)
REFERENCES sensors(sensor_id)
ON DELETE CASCADE
ON UPDATE CASCADE;

View File

@ -0,0 +1,9 @@
ALTER TABLE pressures
DROP CONSTRAINT pk_pressures_sensor_id;
ALTER TABLE pressures
ADD CONSTRAINT fk_pressures_sensor_id
FOREIGN KEY (sensor_id)
REFERENCES sensors(sensor_id)
ON DELETE CASCADE
ON UPDATE CASCADE;