Add index + unique constraint on issue_id and comment_id
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
调研方向
先从 issue 和 comment schema 开始,然后检查 lib/app_web/controllers/event_type_handlers.ex 第 69 行附近的代码以及 Ecto Repo.insert_or_update/2 文档。完成标准是 issue_id 和 comment_id 具有所要求的索引和唯一约束,并且新安装路径会更新现有记录,而不是插入重复记录。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Elixir
- 星标
- 33
- 派生
- 3
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dwyl/github-backup 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 15/100
dwyl/github-backup#138 ·
-
discuss enhancement priority-2
dwyl/github-backup#136 · 10 条评论 · 已指派 1 人 ·
-
😕 未关闭help wanted priority-2
难度 5/5 一周以上 新手友好度 25/100
dwyl/github-backup#135 · 1 条评论 · 3 个 reaction ·
-
enhancement
难度 5/5 一周以上 新手友好度 20/100
dwyl/github-backup#133 ·
-
discuss priority-4 technical
难度 5/5 一周以上 新手友好度 20/100
dwyl/github-backup#132 · 3 条评论 · 1 个 reaction ·
查看 dwyl/github-backup 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
carverauto/serviceradar#4596 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
agentjido/jido_harness#80 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
sevenseacat/cinder#235 ·