refactor(reaction): 收敛为单选接口

This commit is contained in:
2026-08-06 07:53:06 -06:00
parent 776b470457
commit 8d8ab01d8b
8 changed files with 124 additions and 34 deletions

View File

@@ -22,7 +22,9 @@ class Reaction(models.Model):
class Meta:
db_table = "reaction"
unique_together = ("problem", "user", "type")
constraints = [
models.UniqueConstraint(fields=["problem", "user"], name="reaction_problem_user_unique"),
]
indexes = [
models.Index(fields=["problem", "type"], name="reaction_problem_type_idx"),
]