Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

models: Drop unique index on user/message/emoji_name.

Alex Vandiver52b8a84219b7
diff --git a/zerver/migrations/0431_alter_archivedreaction_unique_together_and_more.py b/zerver/migrations/0431_alter_archivedreaction_unique_together_and_more.py
new file mode 100644
index 00000000000..90fe2c36b7d
--- /dev/null
+++ b/zerver/migrations/0431_alter_archivedreaction_unique_together_and_more.py
@@ -0,0 +1,20 @@
+# Generated by Django 4.1.6 on 2023-02-25 01:22
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("zerver", "0430_fix_audit_log_objects_for_group_based_stream_settings"),
+ ]
+
+ operations = [
+ migrations.AlterUniqueTogether(
+ name="archivedreaction",
+ unique_together={("user_profile", "message", "reaction_type", "emoji_code")},
+ ),
+ migrations.AlterUniqueTogether(
+ name="reaction",
+ unique_together={("user_profile", "message", "reaction_type", "emoji_code")},
+ ),
+ ]
diff --git a/zerver/models.py b/zerver/models.py
index 1ea42b1c065..5b6942cb15f 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -3169,10 +3169,7 @@ class AbstractEmoji(models.Model):
class AbstractReaction(AbstractEmoji):
class Meta:
abstract = True
- unique_together = (
- ("user_profile", "message", "emoji_name"),
- ("user_profile", "message", "reaction_type", "emoji_code"),
- )
+ unique_together = ("user_profile", "message", "reaction_type", "emoji_code")
class Reaction(AbstractReaction):