Suppose I have the following scheme:
CREATE TABLE `users` ( `id` int(10) unsigned auto_increment, `historyId` varchar(255), PRIMARY KEY (`id`) ); CREATE TABLE `histories` ( `id` int(10) unsigned auto_increment, `history` TEXT, PRIMARY KEY (`id`) );
A user only ever has one story, and the goal of not having a story points to users, so many other tables (not mentioned in this diagram) also have stories.
What is the easiest way to make deleting a user also delete their history?
source share