Remove dead agency_id column from users (completes #414) - #2307
Draft
maebeale wants to merge 1 commit into
Draft
Conversation
Legacy FK carried from the old schema; prod holds no values. Its only live readers were a vestigial call in the workshops summary (passed a now-always-nil org filter — swapped for an explicit nil, behavior unchanged) and a legacy permitted param. Completes #414 (affiliations half shipped in #2305). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
🤖 suggested review level: 3 Read 📖 drops an unused column + FK + index and cuts over two legacy readers; behavior-preserving
Why
users.agency_idis a legacy FK carried from the old schema. Prod holds no values (all NULL — re-verified:SELECT COUNT(*) FROM users WHERE agency_id IS NOT NULL;→ 0).affiliations.organization_agency_idhalf shipped in Remove dead organization_agency_id column from affiliations #2305; this is theusers.agency_idhalf.What
up/down, both idempotent and rollback-tested.workshops_controller#summarypassedcurrent_user.agency_idas the org filter intoorganization_workshop_logs. Since that value is always NULL in prod, the method already returns nil; swapped to an explicitnil— identical behavior, no column dependency.users_controllerdropped:agency_idfrom the legacy permitted-params list.Notes for reviewer
summarydoesauthorize! @combined_workshop_logs, which isauthorize! nilwhenever the combined logs are empty (i.e. always, in prod). Not introduced here — flagging as a possible follow-up.Closes #414