diff --git a/assistant/migrations/0008_alter_sharedthread_uuid.py b/assistant/migrations/0008_alter_sharedthread_uuid.py new file mode 100644 index 00000000..682b1d96 --- /dev/null +++ b/assistant/migrations/0008_alter_sharedthread_uuid.py @@ -0,0 +1,19 @@ +# Generated by Django 5.0.7 on 2024-07-14 22:18 + +import uuid +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assistant', '0007_alter_sharedthread_uuid'), + ] + + operations = [ + migrations.AlterField( + model_name='sharedthread', + name='uuid', + field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True), + ), + ] diff --git a/assistant/models.py b/assistant/models.py index 3d2f021a..d5e49cb3 100644 --- a/assistant/models.py +++ b/assistant/models.py @@ -33,7 +33,7 @@ def get_absolute_url(self): class SharedThread(models.Model): - uuid = models.UUIDField(default=uuid.uuid4, editable=False, db_index=True) + uuid = models.UUIDField(default=uuid.uuid4, editable=False, db_index=True, unique=True) creator = models.ForeignKey('users.User', on_delete=models.CASCADE) thread = models.ForeignKey(Thread, on_delete=models.CASCADE) data = models.JSONField()