Skip to content

Updated the user_quests table constraint#34

Merged
MelonChicken merged 3 commits into
mainfrom
dev
Jun 10, 2026
Merged

Updated the user_quests table constraint#34
MelonChicken merged 3 commits into
mainfrom
dev

Conversation

@MelonChicken

Copy link
Copy Markdown
Collaborator

Summary

Updated the user_quests table constraint to allow users to receive the same quest on different dates.

Changes

  • Changed the unique constraint from preventing duplicate user-quest pairs globally to checking duplicates per date.
  • Updated the constraint to:
UNIQUE(user_id, quest_id, assigned_date)

Reason

Previously, if a user received a quest yesterday, the same quest could not be assigned again today. Because INSERT OR IGNORE silently skipped duplicated rows, some users received fewer than three daily quests.

image image

This change ensures that each user can receive the same quest again on a different day, while still preventing duplicate assignments for the same quest on the same date.

@MelonChicken MelonChicken merged commit 7aeb871 into main Jun 10, 2026
1 check passed
@MelonChicken MelonChicken changed the title Dev Updated the user_quests table constraint Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant