Repository navigation
Conversation
The members.unsubscribed boolean has been dead since 2014. The only read, a default_scope on Member, was removed in 59df6c1 (2014-06-22). The only write, the MembersController#unsubscribe action, was removed in 0cdd988 (2014-08-24) when the action became a token-based redirect to the subscriptions page. Ignore the column before dropping it. Old releases build their member SELECT list from their schema cache and name every column explicitly, so a drop while old dynos still serve under Heroku preboot would fail every member query on them. The column itself is removed with a safety_assured remove_column in a separate deploy. Part of codebar#3007.
Step 2 of codebar#3007. The members.unsubscribed boolean has been dead since 2014 and is now removed from the schema, with the absence pinned in the member spec. The column held 84 true values from 2013-2014 unsubscribe clicks; per codebar#3007 the drop changes no subscription state. Merge only after the ignored_columns change has deployed: old releases name the column in their member SELECT list, built from the schema cache at boot, and dropping it while they still serve would fail every member query during the Heroku preboot switch.
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.
Problem
Step 2 of #3007: drop the dead
members.unsubscribedcolumn. Stacked on #3013 (step 1, ignored_columns).Change
safety_assured { remove_column :members, :unsubscribed, :boolean }, schema regenerated, and a spec pins that the column is gone from the database.The diff shows both commits until #3013 merges, then narrows to the drop migration. Merge this only after #3013 has deployed to production: old releases name the column in their member SELECT list, and dropping it while they still serve would fail every member query during the Heroku preboot switch.
Review notes
remove_columncarries the column type so it stays reversible, andsafety_assuredmarks that the old release tolerates the drop once chore(members): ignore the dead unsubscribed column聽#3013 has shipped.