refactor: update model association to cascade on delete

This commit is contained in:
pablohashescobar 2023-02-06 23:20:21 +05:30
parent f69b76c77d
commit cd41a05022

View File

@ -28,7 +28,7 @@ class APIToken(BaseModel):
choices=((0, "Human"), (1, "Bot")), default=0 choices=((0, "Human"), (1, "Bot")), default=0
) )
workspace = models.ForeignKey( workspace = models.ForeignKey(
"db.workspace", related_name="api_tokens", on_delete=models.SET_NULL, null=True "db.Workspace", related_name="api_tokens", on_delete=models.CASCADE, null=True
) )
class Meta: class Meta: