Skip to content

7297 - Drop the legacy notifications table - #7479

Open
costajohnt wants to merge 3 commits into
rubyforgood:mainfrom
costajohnt:fix/drop-legacy-notifications-table
Open

costajohnt wants to merge 3 commits into
rubyforgood:mainfrom
costajohnt:fix/drop-legacy-notifications-table

Conversation

@costajohnt

@costajohnt costajohnt commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Closes #7297

What changed, and why?

The notifications table is left over from Noticed v1. The 20240604121427_migrate_notifications after_party task copied its rows into noticed_events and noticed_notifications in 2024, and nothing has read or written the old table since.

  • Added a migration that drops notifications. It passes the column list to drop_table, so rolling it back recreates the table (structure only, not the old rows).
  • Deleted lib/tasks/deployment/20240604121427_migrate_notifications.rake. It was the only code that used the old table, and after_party has already recorded it as run in production.
  • Removed that file's entry from .standard_todo.yml.
  • Regenerated db/schema.rb. The only changes are the removed table and the version bump. noticed_events and noticed_notifications are untouched.

User#notifications still points at Noticed::Notification, so nothing changes in the app.

How is this tested? (please write rspec and jest tests!) 💖💪

  • bin/rails db:migrate, then bin/rails db:rollback, then bin/rails db:migrate again in development. The rollback recreates the table with the original columns, and the schema comes back identical each time.
  • In the test env: loaded the schema from main, ran db:migrate, and checked that notifications is gone and both noticed tables are still there. A fresh db:schema:load gives the same result.
  • bundle exec rake after_party:run runs clean without the deleted task.
  • bundle exec rspec spec/notifications spec/requests/notifications_spec.rb spec/lib/tasks/rake_tasks_constants_spec.rb spec/lib/tasks/data_post_processors/case_contact_populator_spec.rb spec/helpers/notifications_helper_spec.rb: 61 examples, 0 failures
  • bundle exec rspec spec/services/emancipation_checklist_reminder_service_spec.rb spec/services/volunteer_birthday_reminder_service_spec.rb spec/models/user_spec.rb spec/helpers/sidebar_helper_spec.rb: 69 examples, 0 failures
  • bundle exec standardrb and bundle exec rake factory_bot:lint both pass.

If you want to double check before merging, the issue suggests comparing production's notifications row count with the noticed_events created before 2024-06-04.

Screenshots please :)

No UI changes.

Feelings gif (optional)

The notifications table is left over from Noticed v1. The
20240604121427_migrate_notifications after_party task copied its rows
into noticed_events and noticed_notifications in 2024, and nothing has
read or written it since.

Add a migration that drops it, passing the column list so the
migration can be rolled back. Remove the after_party task, which was
the only code that used the table and has already run, along with its
.standard_todo.yml entry.
@github-actions github-actions Bot added ruby Touches Ruby code db Touches database schema or migrations labels Nov 27, 2026
costajohnt and others added 2 commits December 2, 2026 16:42
Resolve db/schema.rb by regenerating it: load main's schema, then run
db:migrate (only 20261127120000_drop_notifications pending).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db Touches database schema or migrations ruby Touches Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop the legacy notifications table (unused since the Noticed v2 migration in 2024)

1 participant