Drop the legacy notifications table (unused since the Noticed v2 migration in 2024)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
app、lib、config で notifications を grep し、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
- スター
- 382
- フォーク
- 547
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 46
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rubyforgood/casa のほかの issue
-
Remove leftover Cloud66 custom_web process from Procfile対応中かも @ShahadatTest が 1 日前に担当しました。 オープンDifficulty: Easy Good First Issue
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
rubyforgood/casa#7330 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Remove the bin/bundle binstub (Heroku warns it can break Bundler on deploy)対応中かも @KoushikSagarr が 1 日前に担当しました。 オープンdependencies Difficulty: Easy Good First Issue
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
rubyforgood/casa#7325 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Difficulty: Easy Good First Issue Help Wanted javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rubyforgood/casa#7311 ·
メンテナーはふだん 1 日以内に返信
-
Difficulty: Easy Good First Issue Help Wanted javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rubyforgood/casa#7310 ·
メンテナーはふだん 1 日以内に返信
-
Difficulty: Easy Good First Issue Help Wanted javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rubyforgood/casa#7309 ·
メンテナーはふだん 1 日以内に返信
rubyforgood/casa の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
akitaonrails/ai-book-2026#12 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openfoodfoundation/openfoodnetwork#14970 ·
メンテナーはふだん 1 日以内に返信
-
JWT::EncodedToken raises TypeError for a non-object header対応中かも @anakinj が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jwt/ruby-jwt#780 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信