chore: remove unused member_type from member_email_deliveries - #2829
Merged
Conversation
Added in PR #2449 for polymorphism that was never built: no code reads or writes it, and it is NULL in all production rows (recipients are always Members). The model ignores the column so stale schema caches during rolling deploys are safe. Re-add with a polymorphic association if non-member recipients ever arrive.
olleolleolle
approved these changes
Aug 31, 2026
olleolleolle
left a comment
Collaborator
There was a problem hiding this comment.
We thank it and let it go.
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.
Problem
member_email_deliveries.member_typeis dead weight. It was added in #2449 (same day as the table) for polymorphism that was never built: the model is a plainbelongs_to :member, theEmailDeliveryconcern never writes it, nothing reads it, and it isNULLin all 439 production rows.Change
safety_assured— same single-phase pattern as thecan_log_inremoval in20260806000000; safe because no code references the column, so old dynos during a rolling deploy cannot break)ignored_columnson the model to guard stale schema caches, matching thecan_log_inprecedentIf non-
Memberrecipients ever need email logging, re-add the column together with a real polymorphic association.Testing
Migration applied to dev and test databases;
member_mailerandthree_month_email_servicespecs pass (32 examples, including the chaser logging spec that writes rows through the concern). RuboCop clean.Context
Found during the #2384 brainstorm while investigating the table's history.