From 98cd389e8ad2fe3bc26679d2e5139332106ff6ac Mon Sep 17 00:00:00 2001 From: Vinogradov Anton Date: Wed, 28 Aug 2024 22:03:32 +0300 Subject: [PATCH] fix: changed on_delete func from CASCADE to DO_NOTHING in all models --- application/backend/projects/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/backend/projects/models.py b/application/backend/projects/models.py index 3df81be..bf36a1c 100644 --- a/application/backend/projects/models.py +++ b/application/backend/projects/models.py @@ -27,7 +27,7 @@ class Report(models.Model): anyone_going_vacation = models.CharField(max_length=100,default="Nobody") other_comments = models.TextField(max_length=1000,default="Nothing") report_creater = models.ForeignKey(Employee, on_delete = models.DO_NOTHING,default=0) - related_project = models.ForeignKey(to="Project",on_delete=models.CASCADE,default=0) + related_project = models.ForeignKey(to="Project",on_delete=models.DO_NOTHING,default=0) is_deleted = models.BooleanField(default=False) final_report_color = models.CharField(max_length=1,choices=COLOR_CHOICES,default='G') @@ -52,7 +52,7 @@ class Objective(models.Model): } objective_name = models.CharField(max_length=100) objective_color = models.CharField(max_length=1,choices=COLOR_CHOICES,default="G") - related_report = models.ForeignKey(to = "Report", on_delete=models.CASCADE,default=0) + related_report = models.ForeignKey(to = "Report", on_delete=models.DO_NOTHING,default=0) is_deleted = models.BooleanField(default=False) objective_descripion = models.CharField(max_length=100) def __str__(self):