Skip to content

🗃️ delete duplicate checkins; add unique key#4695

Draft
MrKrisKrisu wants to merge 1 commit into
developfrom
dev-ks/duplicates
Draft

🗃️ delete duplicate checkins; add unique key#4695
MrKrisKrisu wants to merge 1 commit into
developfrom
dev-ks/duplicates

Conversation

@MrKrisKrisu
Copy link
Copy Markdown
Member

fixes #2876

I would like to add a UNIQUE constraint to the database to prevent duplicate check-ins. Unfortunately, this has been possible (again) since 2024, as the UNIQUE constraint was accidentally deleted.

My approach:

This migration checks for duplicate check-ins. (= A user checked in at the same station at the same time during a trip.)

The oldest check-in (lowest ID) is keept; the others are deleted.

However, I don’t want to run this without first opening it up for discussion. Do you see any issues with this?

@MrKrisKrisu
Copy link
Copy Markdown
Member Author

Note: This PR is currently on hold. To avoid deleting user data without permission, I would like to create a separate PR to give users with duplicate check-ins the opportunity to clean this up themselves first. I would then notify the users and set a deadline. After the deadline, I would merge this PR and delete the duplicate check-ins.

@MrKrisKrisu
Copy link
Copy Markdown
Member Author

Blog post published: https://blog.traewelling.de/posts/duplicate-checkins/

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate checkins possible

1 participant