Skip to content

Commit 0e36c54

Browse files
committed
Add some comments about ID type choices
1 parent 2d64fc2 commit 0e36c54

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pgcommitfest/commitfest/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,14 @@ class CfbotTask(models.Model):
375375
('ERRORED', 'Errored'),
376376
]
377377

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

0 commit comments

Comments
 (0)