[Bug] The foreign key constraint in the creation of `HazardFieldIntensity` is wrong
The table HazardFieldIntensity
is created as below:
CREATE TABLE HazardFieldIntensity (
hazard_field_node_id INTEGER,
intensity_type_id INTEGER,
intensity_value REAL,
CONSTRAINT fk_hazard_field_node_id FOREIGN KEY (hazard_field_node_id) REFERENCES HazardFieldNode (id),
CONSTRAINT fk_intensity_type_id FOREIGN KEY (intensity_type_id) REFERENCES IntensityType (intensity_type)
)
The last line should change to REFERENCES IntensityType (id)
to avoid the error of sqlite3.IntegrityError: FOREIGN KEY constraint failed
.
Edited by Danijel Schorlemmer