Skip to content

chore(members): drop the dead unsubscribed column - #3014

Open
mroderick wants to merge 2 commits into
codebar:masterfrom
mroderick:chore/drop-unsubscribed-column
Open

mroderick wants to merge 2 commits into
codebar:masterfrom
mroderick:chore/drop-unsubscribed-column

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Problem

Step 2 of #3007: drop the dead members.unsubscribed column. 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

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant