Hello, I figured out a workaround, I don’t know if that is still the best way to implement triggers, I didn’t work on this project since May 2021 and there may have been updates to Strapi that changed that.
What I did was create the data models in Strapi and have the CMS create the database.
After that I created my triggers on top of the database that was made by the CMS.
I didn’t manually create the tables, if you do that and create foreign keys, it will not work. So I just ‘pretend’ that the properties in the tables are foreign keys and I treated them as such.
I don’t remember what happens in the case you delete a collection entry that is associated with another collection.
TLDR; just don’t use foreign keys at all, you can setup relationships in Strapi