Skip to content

chore(members): ignore the dead unsubscribed column - #3013

Open
mroderick wants to merge 1 commit into
codebar:masterfrom
mroderick:chore/ignore-dead-unsubscribed-column
Open

mroderick wants to merge 1 commit into
codebar:masterfrom
mroderick:chore/ignore-dead-unsubscribed-column

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Problem

members.unsubscribed has been dead since 2014: nothing has read it since June 2014 and nothing has written it since August 2014. #3007 removes the column in two steps, because production runs with Heroku preboot.

Change

Step 1 of #3007: Member.ignored_columns now carries unsubscribed, so the column drops out of the model's SELECT list and its attribute methods. A spec pins that Member.new no longer responds to unsubscribed.

Old releases name every member column explicitly in their SELECT list, built from the schema cache at boot. Dropping the column while old dynos still serve would fail every member query with PG::UndefinedColumn during the preboot switch, so the remove_column follows in a separate deploy in a stacked PR that merges only after this has shipped.

Review notes

  • Start with the preboot reasoning in the commit message. It is why this is a two-deploy removal instead of one migration.
  • The ignored_columns line merges the existing can_log_in entry into one %w array.
  • Deliberately not done: no migration in this PR.

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.

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