'TypeError: SET_NULL() missing 4 required positional arguments: 'collector', 'field', 'sub_objs', and 'using'
How do i solve the above error which shows up not during the makemigrations but during migrate in Django.
class Comment(models.Model):
#comment_id=models.IntegerField(primary_key=True)
name=models.CharField(max_length=100, default="No Comment Added")
comment_created=models.DateTimeField(auto_now_add=True)
task=models.ForeignKey(task_check, on_delete=models.SET_NULL, null=True )
task_records=models.ForeignKey(task_check_Records, on_delete=models.CASCADE, null=True, default=models.SET_NULL)
def __str__(self):
return self.name
Solution 1:[1]
Solution 2:[2]
Remove files from app_name/migrations and migrate after makemigrations again.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ashkan Khoshbash |
Solution 2 | Yunnosch |