First I want to say I've never tried using triggers before, and I read a lot of information to do this. What I want to do is delete all records from gallery_assets_meta where its parent_id is equal to gallery_assets.id.
This was what I tried on sequel pro:
My Sql code:
BEGIN
DELETE FROM gallery_assets_meta
WHERE gallery_assets_meta.parent_id = old.id;
END
When I try to delete a record from gallery_assets I get this error: