I’m creating some database triggers to get rid of excess data. For example, when a user is deleted, delete everything related to it, for example chats, interests and so on.
This seems like easy enough of a task, but isn’t working.
I have a data type for chats and a data type for messages. Chat contains a list of messages, every message has a “chat” attribute. When a chat is deleted, the messages should also be deleted.
Here’s my workflow, which doesn’t work. After I delete the chat (I’m doing it straight in the database, not on a page using a button or anything), the messages still remain, only their “chat” attribute shows “deleted thing”, as it should without database triggers.
Any ideas what I’m doing wrong here?