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 0000000000..90fe2c36b7 --- /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 1ea42b1c06..5b6942cb15 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):