Add index + unique constraint on issue_id and comment_id
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with the issue and comment schemas, then inspect lib/app_web/controllers/event_type_handlers.ex around line 69 and the Ecto Repo.insert_or_update/2 documentation. Done means issue_id and comment_id have the requested indexes and unique constraints, and the new-install path updates existing records instead of inserting duplicates.
Written by the indexing model from the issue text.
Description
The current schemas for issue and comment don't have any unique constraint and index on issue_id and comment_id yet.
This can be useful to make sure the data inserted are correct and to avoid duplicates.
A duplicate values can appear for example if the app is uninstalled and reinstalled again. As we won't automatically delete data in Postgres (see #87) this means that on the install we will save again all the issues and comments (see #65)
After adding these indexes and constraints we will need to update the Repo.insertfunction on new install toRepo.insert_or_update`:
https://github.com/dwyl/github-backup/blob/2960a82e0f2d89853d86380db4e5841677bbdbf3/lib/app_web/controllers/event_type_handlers.ex#L69
see https://hexdocs.pm/ecto/Ecto.Repo.html#c:insert_or_update/2
- Dominant language
- Elixir
- Stars
- 33
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dwyl/github-backup
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 15/100
dwyl/github-backup#138 ·
-
discuss enhancement priority-2
dwyl/github-backup#136 · 10 comments · 1 assignee ·
-
😕 Openhelp wanted priority-2
Difficulty 5/5 Over a week Newbie friendliness 25/100
dwyl/github-backup#135 · 1 comment · 3 reactions ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
dwyl/github-backup#133 ·
-
discuss priority-4 technical
Difficulty 5/5 Over a week Newbie friendliness 20/100
dwyl/github-backup#132 · 3 comments · 1 reaction ·
All issues in dwyl/github-backup
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
carverauto/serviceradar#4596 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
agentjido/jido_harness#80 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sevenseacat/cinder#235 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100