diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py index ff0d7836..32602424 100644 --- a/pgcommitfest/commitfest/models.py +++ b/pgcommitfest/commitfest/models.py @@ -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")