Repository navigation
7297 - Drop the legacy notifications table - #7479
Open
costajohnt wants to merge 3 commits into
Open
costajohnt wants to merge 3 commits into
costajohnt wants to merge 3 commits into
Conversation
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.
costajohnt
requested review from
FireLemons,
compwron and
elasticspoon
as code owners
November 27, 2026 22:19
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What github issue is this PR for, if any?
Closes #7297
What changed, and why?
The
notificationstable is left over from Noticed v1. The20240604121427_migrate_notificationsafter_party task copied its rows intonoticed_eventsandnoticed_notificationsin 2024, and nothing has read or written the old table since.notifications. It passes the column list todrop_table, so rolling it back recreates the table (structure only, not the old rows).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..standard_todo.yml.db/schema.rb. The only changes are the removed table and the version bump.noticed_eventsandnoticed_notificationsare untouched.User#notificationsstill points atNoticed::Notification, so nothing changes in the app.How is this tested? (please write rspec and jest tests!) 💖💪
bin/rails db:migrate, thenbin/rails db:rollback, thenbin/rails db:migrateagain in development. The rollback recreates the table with the original columns, and the schema comes back identical each time.db:migrate, and checked thatnotificationsis gone and both noticed tables are still there. A freshdb:schema:loadgives the same result.bundle exec rake after_party:runruns 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 failuresbundle 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 failuresbundle exec standardrbandbundle exec rake factory_bot:lintboth pass.If you want to double check before merging, the issue suggests comparing production's
notificationsrow count with thenoticed_eventscreated before 2024-06-04.Screenshots please :)
No UI changes.
Feelings gif (optional)