Modify database tables foreign key relationships so that they use CASCADE DELETE #166
travisaustin
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
@travisaustin Unfortunately CASCADE DELETE isn't supported by all the databases that Laravel supports. The migrations are published and tracked as part of your project which allows you to add those extra constraints if you need them. Maybe instead we should just add a note in the documentation somewhere? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, it's not easy to delete a historical workflow after it is completed. You first have to delete all related rows from the tables that store signals, timers, exceptions, logs, and relationships.
My project has a lot of job (and soon workflow) activity, and I anticipate that I will need to regularly prune the workflows from the database to keep the size at bay. It would be much simpler to implement the pruning process if I modified the foreign key relationships in the database so that deleting a workflow cascades that delete statement to all logs, exceptions, signals, timers, and child workflows. This would allow deleting the parent workflow, and it would clean up all related database entries automatically.
I intend to make this change for my project, but is there any interest in incorporating this into the project as a whole? If so, I'll submit a PR.
Beta Was this translation helpful? Give feedback.
All reactions