spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

DELETE CASCADE on Foreign Keys

Open hannosgit opened this issue 1 year ago • 8 comments

Current Behaviour

The current implementation to delete job instances or job executions issues a separate SQL statement for each metadata table. (see https://github.com/spring-projects/spring-batch/pull/4497)

Suggested Change

If we define the DELETE CASCADE option on each Foreign Key in the metadata table, we could remove all metadata by simply deleting the desired table row and the database will take care of the rest. As far as I can see each supported database supports the DELETE CASCADE option

hannosgit avatar Feb 25 '24 08:02 hannosgit