The Wayback Machine - https://web.archive.org/web/20210811104051/https://github.com/discourse/discourse/pull/12785
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: Do not dump schema during production database migrations #12785

Merged
merged 1 commit into from Apr 21, 2021

Conversation

@davidtaylorhq
Copy link
Member

@davidtaylorhq davidtaylorhq commented Apr 21, 2021

It's important that we don't perform pg_dumps against databases
running behind pgbouncer.

We had an old monkey-patch to prevent this, but following some recent
internal rails refactoring
,
the patch no longer works. Instead, we can use the official
config.active_record.dump_schema_after_migration option.

Setting this to false in production is recommended by Rails, and is the
default for newly generated Rails applications.

It's important that we don't perform pg_dumps against databases
running behind pgbouncer.

We had an old monkey-patch to prevent this, but following some [recent
internal rails refactoring](rails/rails@5488686),
the patch no longer works. Instead, we can use the official
`config.active_record.dump_schema_after_migration` option.

Setting this to false in production is recommended by Rails, and is the
default for newly generated Rails applications.
@davidtaylorhq davidtaylorhq requested a review from ZogStriP Apr 21, 2021
@davidtaylorhq davidtaylorhq merged commit 65164bf into master Apr 21, 2021
8 checks passed
8 checks passed
@github-actions
core backend
Details
@github-actions
plugins backend
Details
@github-actions
core frontend
Details
@github-actions
plugins frontend
Details
@lgtm-com
LGTM analysis: JavaScript No code changes detected
Details
license/cla Contributor License Agreement is signed.
Details
@davidtaylorhq davidtaylorhq deleted the rails-6-1-schema-dump branch Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants