How do you handle threads?

Hi Teksyndicate Team, specially Wendell,

 

How do you guys handle the backend of a thread? I was just thinking if maybe I can get some realworld advice from you guys.

 

Basically this is what's going on. I have a ThreadTable with ThreadID as a PrimaryKey that is related to a CommentTable's ThreadID as the foreignkey. Natively you cant delete the ThreadTable's ThreadID because it's being used by the CommentTable's  ThreadID.

My objective is to automatically delete all the comments when the thread is deleted. with the native sql relation this wont work because if I am going to delete a thread it wont allow me because the comments are attached to it. 

 

If you guys have a better approach please feel free to say.

 

Thanks,