From 8d63300cca2478230e4a739d9e4a5186c47211c8 Mon Sep 17 00:00:00 2001 From: Ryan Gossiaux Date: Sun, 15 Dec 2024 00:24:37 -0800 Subject: [PATCH] Remove unique constraint on chat room names Fixes #763 I think the actual constraint we would want is unique names per server, but this model doesn't have that info. As it is this caused problems last year when puzzles had titles identical to previous year puzzles. --- ...ove_chatroom_unique_room_name_per_service.py | 17 +++++++++++++++++ chat/models.py | 7 ------- 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 chat/migrations/0010_remove_chatroom_unique_room_name_per_service.py diff --git a/chat/migrations/0010_remove_chatroom_unique_room_name_per_service.py b/chat/migrations/0010_remove_chatroom_unique_room_name_per_service.py new file mode 100644 index 00000000..27daaa40 --- /dev/null +++ b/chat/migrations/0010_remove_chatroom_unique_room_name_per_service.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.13 on 2024-12-15 08:23 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("chat", "0009_alter_chatrole_id_alter_chatroom_id"), + ] + + operations = [ + migrations.RemoveConstraint( + model_name="chatroom", + name="unique_room_name_per_service", + ), + ] diff --git a/chat/models.py b/chat/models.py index 13f39091..a58553d3 100644 --- a/chat/models.py +++ b/chat/models.py @@ -55,13 +55,6 @@ class ChatRoom(models.Model): audio_channel_url = models.URLField(null=True, blank=True) audio_channel_id = models.CharField(max_length=255, null=True, blank=True) - class Meta: - constraints = [ - models.UniqueConstraint( - name="unique_room_name_per_service", fields=["service", "name"] - ), - ] - def __str__(self): return self.name