重构 #4
| @@ -49,7 +49,7 @@ type Plan struct { | ||||
| 	// SubPlans 直接与此计划关联的子计划。仅当 ContentType 为 PlanContentTypeSubPlans 时有效。 | ||||
| 	SubPlans []SubPlan `gorm:"foreignKey:ParentPlanID" json:"sub_plans"` | ||||
| 	// Tasks 直接与此计划关联的任务。仅当 ContentType 为 PlanContentTypeTasks 时有效。 | ||||
| 	Tasks []Task `gorm:"foreignKey:PlanID" json:"tasks"` | ||||
| 	Tasks []Task `gorm:"foreignKey:PlanID;constraint:OnDelete:CASCADE;" json:"tasks"` | ||||
| } | ||||
|  | ||||
| // TableName 自定义 GORM 使用的数据库表名 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user