Database triggers not working

Hello, I’m trying to insert a new entry into a colllection that has a trigger in the database.
I was supposed to have a trigger on INSERT, UPDATE and DELETE on that table.
The only trigger which gets non null values for foreign key fields is the UPDATE trigger.
INSERT and DELETE triggers set all foreign key values as null inside the NEW or OLD.

Why is this happening and why wont strapi send a proper query for INSERT or DELETE operations, instead it looks like it’s inserting values for non fk fields and then updating the fk fields afterwards.

This behaviour makes my INSERT or DELETE triggers not do anything at all and it’s very important for my data that they execute correctly or the data will become illogical. (Trying to have a leaderboard of matches that were played, and in case of for example deletion of a entry in matches table, I want to update the teamleaderboard table for the teams that played on those matches, specifically to adjust their wins or losses to reflect the deletion of the match row).