Deleteing related files?
Suppose I have two tables ...
Table one
dog_id
dog_name
Table two
picture_id
picture_dog_id
Picture_file
Table one is a table of dogs and their names. Table two is a table of extra photos for each dog using the dog_id and picture_dog_id as the relationship between the two.
Is it possible on deletion of a dog from table one to delete the related images or even prevent deletion of the dog if there is matching images?


This is one of the nice things about using a delete server behavior for the records. If you filter the delete where the id matches the id of the record you are removing then it does not matter if you have one or a thousand records that have that id as the foreign key, they will all be deleted since they match the criteria. 
