crs-tools / tracker

CRS Ticket Tracker
Apache License 2.0
18 stars 11 forks source link

Missing foreign key references #204

Closed saerdnaer closed 5 years ago

saerdnaer commented 5 years ago

When I looked into the database schema, I found following "missing" foreign key refernces – was this accidental or by design?

ALTER TABLE tbl_comment
  ADD FOREIGN KEY ("ticket_id") REFERENCES tbl_ticket("id"),
  ADD FOREIGN KEY ("handle_id") REFERENCES tbl_handle("id");

ALTER TABLE tbl_log
  ADD FOREIGN KEY ("ticket_id") REFERENCES tbl_ticket("id"),
  ADD FOREIGN KEY ("handle_id") REFERENCES tbl_handle("id");

ALTER TABLE tbl_ticket_property 
  ADD FOREIGN KEY ("ticket_id") REFERENCES tbl_ticket("id");
a-tze commented 5 years ago

I dont understand. Where did you look and where is it missing?

For example, the first FK constraint you mention is here:

https://github.com/crs-tools/tracker/blob/master/src/Application/Migrations/07_comments.sql#L14

The second one has been replaced by a trigger function.

saerdnaer commented 5 years ago

I used a database backup of the voc instance, and have to check the schema once I create a new database instance from scratch.

jjeising commented 5 years ago

If you still think there is something missing, please reopen.