Drop the legacy notifications table (unused since the Noticed v2 migration in 2024)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先在 app、lib 和 config 中搜索 notifications,然后阅读 db/schema.rb 中的表定义以及旧的 rake 文件 lib/tasks/deployment/20240604121427_migrate_notifications.rake。添加一个可逆的迁移,删除 notifications 表及其列清单。然后删除该 rake 文件,以及 .standard_todo.yml 中对应的条目(如有)。完成的标准是:bin/rails db:migrate 会更新 db/schema.rb,noticed_events 和 noticed_notifications 保持不变,并且通知相关的 spec 全部通过。
由索引模型根据 Issue 内容生成。
描述
Problem
The legacy notifications table (Noticed v1) has been unused since the 2024 upgrade to Noticed v2. The after_party task lib/tasks/deployment/20240604121427_migrate_notifications.rake copied its rows into noticed_events / noticed_notifications, and nothing has read or written it since. It still takes ~1.1 MB in production and shows up in db/schema.rb, which confuses people reading the schema (notifications vs noticed_notifications).
What to do
- Add a migration that drops the table:
drop_table :notifications. Strong Migrations is enabled, so give it a full reversible definition (pass the column list fromdb/schema.rbtodrop_tablesodowncan recreate it) and wrap it insafety_assuredif Strong Migrations asks. - Delete
lib/tasks/deployment/20240604121427_migrate_notifications.rake. It's the only code that touches the old table, and it has already run in production: after_party records it intask_records, so removing the file is safe. - Remove its entry from
.standard_todo.ymlif present. - Make sure nothing else refers to the old table:
grep -rn "notifications" app lib config.User#notificationsisclass_name: "Noticed::Notification"(the new table), so leave it alone. - Run
bin/rails db:migrateand commit the updateddb/schema.rb. Make surenoticed_eventsandnoticed_notificationsare untouched. - Run the notification specs:
spec/notifications,spec/requests/notifications_spec.rb,spec/lib/tasks/rake_tasks_constants_spec.rb.
Notes
- Heroku runs migrations automatically in the release phase, so this will apply on the next deploy.
- If you want to be extra careful, a maintainer can check that production's
notificationsrows were all migrated before merging (e.g. compare counts withnoticed_eventscreated before 2024-06-04), but the table hasn't been written since then either way.
Difficulty: beginner. One migration plus deleting one file.
- 主要语言
- Ruby
- 星标
- 383
- 派生
- 551
- 平均合并
- 2 天 19 小时
- 30 天内合并 PR
- 49
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rubyforgood/casa 的其他 Issue
-
Remove the bin/bundle binstub (Heroku warns it can break Bundler on deploy)可能已有人在做 @KoushikSagarr 于 4 天前认领。 未关闭dependencies Difficulty: Easy Good First Issue
难度 1/5 1 小时以内 新手友好度 82/100
rubyforgood/casa#7325 · 1 条评论 ·
维护者通常 1 天内回复
-
Reports page: move export-button disable/re-enable into a Stimulus controller可能已有人在做 @Akash-Dhanwate 今天认领。 未关闭Difficulty: Easy Good First Issue Help Wanted javascript
难度 2/5 1-3 小时 新手友好度 72/100
rubyforgood/casa#7311 · 1 条评论 ·
维护者通常 1 天内回复
-
New case: use Stimulus for the "I don't know the court date yet" toggle可能已有人在做 @Aryankn29 今天认领。 未关闭Difficulty: Easy Good First Issue Help Wanted javascript
难度 2/5 1-3 小时 新手友好度 78/100
rubyforgood/casa#7310 · 1 条评论 ·
维护者通常 1 天内回复
-
Difficulty: Easy Good First Issue Help Wanted javascript
难度 2/5 1-3 小时 新手友好度 78/100
rubyforgood/casa#7309 ·
维护者通常 1 天内回复
-
🖥️ Frontend Difficulty: Easy Good First Issue Help Wanted javascript
难度 2/5 1-3 小时 新手友好度 75/100
rubyforgood/casa#7308 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
Malformed encoded_filters causes a 500, and keeps failing with session persistence可能已有人在做 @officialasishkumar 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
endoflife-date/endoflife.date#11561 ·
维护者通常 1 天内回复