Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix old migrations failing because of strong_migrations update #12692

Merged
merged 1 commit into from
Dec 29, 2019

Conversation

ClearlyClaire
Copy link
Contributor

Fixes #12690

The strong_migrations update from ba2eac8
introduced a check for change_column_null specific to Postgres. This rejects
old migrations.

This commit just wraps old migrations with safety_assured to bypass this
check. Alternatives would have been to:

  • Disable that check entirely (a possibility added in that same
    strong_migrations version) for Mastodon, but it makes sense to write new
    migrations without such a strong lock.
  • Rewrite the old migrations to do it in a way that do not require an exclusive
    lock. I thought fixing those old migrations for performance wasn't worth the
    pain. Also, if I understand correctly, the next version of
    strong_migrations is going to include a helper to do that. We could update
    those migrations at that point.

Fixes mastodon#12690

The `strong_migrations` update from ba2eac8
introduced a check for `change_column_null` specific to Postgres. This rejects
old migrations.

This commit just wraps old migrations with `safety_assured` to bypass this
check. Alternatives would have been to:
- Disable that check entirely (a possibility added in that same
  `strong_migrations` version) for Mastodon, but it makes sense to write new
  migrations without such a strong lock.
- Rewrite the old migrations to do it in a way that do not require an exclusive
  lock. I thought fixing those old migrations for performance wasn't worth the
  pain. Also, if I understand correctly, the next version of
  `strong_migrations` is going to include a helper to do that. We could update
  those migrations at that point.
@Gargron Gargron merged commit 1155dc0 into mastodon:master Dec 29, 2019
@ClearlyClaire ClearlyClaire deleted the fixes/strong-migrations-null branch January 6, 2020 13:45
ClearlyClaire added a commit to ClearlyClaire/mastodon that referenced this pull request Jan 6, 2020
ykzts pushed a commit that referenced this pull request Jan 10, 2020
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.

ChangeAccountsNonnullableInAccountModerationNotes is now detected unsafe
2 participants