Skip to content

Commit

Permalink
Add some comments about ID type choices
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Dec 21, 2024
1 parent 2d64fc2 commit 0e36c54
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pgcommitfest/commitfest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,14 @@ class CfbotTask(models.Model):
('ERRORED', 'Errored'),
]

# This id is only used by Django. Using text type for primary keys, has
# historically caused problems.
id = models.BigAutoField(primary_key=True)
# This is the id used by the external CI system. Currently with CirrusCI
# this is an integer, and thus we could probably store it as such. But
# given that we might need to change CI providers at some point, and that
# CI provider might use e.g. UUIDs, we prefer to consider the format of the
# ID opaque and store it as text.
task_id = models.TextField(unique=True)
task_name = models.TextField(null=False)
patch = models.ForeignKey(Patch, on_delete=models.CASCADE, related_name="cfbot_tasks")
Expand Down

0 comments on commit 0e36c54

Please sign in to comment.