DB: task dependencies should be cascade-deleted with their tasks

This commit is contained in:
Sybren A. Stüvel 2022-02-14 15:07:14 +01:00
parent a9790ec579
commit 8e01c069d1

@ -62,7 +62,7 @@ type Task struct {
// TODO: include info about which worker is/was working on this.
// Dependencies are tasks that need to be completed before this one can run.
Dependencies []*Task `gorm:"many2many:task_dependencies;"`
Dependencies []*Task `gorm:"many2many:task_dependencies;constraint:OnDelete:CASCADE"`
Commands Commands `gorm:"type:jsonb"`
}