Manager: on deletion of a worker, do not cascade to deletion of its tasks
Fix an issue where deleting a Worker would also delete the tasks it was assigned to.
This commit is contained in:
parent
b511fad968
commit
859a261b05
@ -48,7 +48,7 @@ type Task struct {
|
|||||||
|
|
||||||
// Which worker is/was working on this.
|
// Which worker is/was working on this.
|
||||||
WorkerID *uint
|
WorkerID *uint
|
||||||
Worker *Worker `gorm:"foreignkey:WorkerID;references:ID;constraint:OnDelete:CASCADE"`
|
Worker *Worker `gorm:"foreignkey:WorkerID;references:ID;constraint:OnDelete:SET NULL"`
|
||||||
LastTouchedAt time.Time `gorm:"index"` // Should contain UTC timestamps.
|
LastTouchedAt time.Time `gorm:"index"` // Should contain UTC timestamps.
|
||||||
|
|
||||||
// Dependencies are tasks that need to be completed before this one can run.
|
// Dependencies are tasks that need to be completed before this one can run.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user