Skip to content

Missing foreign key constraint on web_hooks.group_id

It looks like there is only one for project_id:

Foreign-key constraints:
    "fk_0c8ca6d9d1" FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
Referenced by:
    TABLE "web_hook_logs" CONSTRAINT "fk_rails_666826e111" FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE

We may also want to consider getting rid of this STI table and migrating group hooks into another table (or use an enum type instead of the string type).

Iterations

Adding foreign key constraint to an existing column.

Edited by Arturo Herrero