Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add index + unique constraint on issue_id and comment_id

未关闭
#94 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
elixir, postgresql
领域
backend, database

调研方向

先从 issue 和 comment schema 开始,然后检查 lib/app_web/controllers/event_type_handlers.ex 第 69 行附近的代码以及 Ecto Repo.insert_or_update/2 文档。完成标准是 issue_id 和 comment_id 具有所要求的索引和唯一约束,并且新安装路径会更新现有记录,而不是插入重复记录。

由索引模型根据 Issue 内容生成。

描述

awaiting-review enhancement T25m

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

dwyl/github-backup 的其他 Issue

查看 dwyl/github-backup 的全部 Issue

相似的 Issue

更多 Elixir Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。