Skip to content

Conversation

@Arapak
Copy link

@Arapak Arapak commented Nov 17, 2025

Closes #573
Adds a unique constraint to DifficultyTagProposal for (problem, user) and to AlgorithmTagProposal for (problem, tag, user).
The migration cleans up the duplicates before applying the new constraints

@Arapak Arapak self-assigned this Nov 17, 2025
@Arapak Arapak requested a review from MasloMaslane as a code owner November 17, 2025 23:00
@Arapak Arapak added the bug label Nov 17, 2025
@Arapak Arapak marked this pull request as draft November 18, 2025 09:54
@Arapak Arapak marked this pull request as ready for review December 10, 2025 15:52
from django.db import migrations
from django.db.models import Count

def cleanup_duplicate_proposals(apps, schema_editor):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tried how fast it is on large data?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considering there are around ~300 rows to delete this is shouldn't be a problem, I added the optimization either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate algorithm tag proposals from same user allowed

3 participants