mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:50:37 -06:00
FIX: Do not dump schema during production database migrations (#12785)
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](5488686851
),
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.
This commit is contained in:
parent
e4f1760bab
commit
65164bf189
4
Rakefile
4
Rakefile
@ -7,7 +7,3 @@
|
|||||||
require File.expand_path('../config/application', __FILE__)
|
require File.expand_path('../config/application', __FILE__)
|
||||||
|
|
||||||
Discourse::Application.load_tasks
|
Discourse::Application.load_tasks
|
||||||
|
|
||||||
# this prevents crashes when migrating a database in production in certain
|
|
||||||
# PostgreSQL configuations when trying to create structure.sql
|
|
||||||
Rake::Task["db:structure:dump"].clear if Rails.env.production?
|
|
||||||
|
@ -67,4 +67,5 @@ Discourse::Application.configure do
|
|||||||
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)
|
config.developer_emails = emails.split(",").map(&:downcase).map(&:strip)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.active_record.dump_schema_after_migration = false
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user