dwyl / dwyl/github-backup

Add index + unique constraint on issue_id and comment_id

Đang mở
#94 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
awaiting-review enhancement T25m
Ngôn ngữ chính
Elixir
Star
33
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.insert` function on new install to `Repo.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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với các schema issue và comment, sau đó kiểm tra lib/app_web/controllers/event_type_handlers.ex quanh dòng 69 và tài liệu về Ecto Repo.insert_or_update/2. Hoàn thành khi issue_id và comment_id có các index và ràng buộc unique được yêu cầu, đồng thời đường dẫn cài đặt mới cập nhật các bản ghi hiện có thay vì chèn các bản trùng lặp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
elixir, postgresql
Lĩnh vực
backend, database
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.