mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 12:53:30 +08:00
When Active Record migrates a brand-new Discourse database, Discourse invokes `DatabaseTasks.migrate`, which can initialize the database from `db/structure.sql`. That file clears the session `search_path` and restores it near the end. With PgBouncer transaction pooling, `psql`'s autocommit statements can run on different PostgreSQL backends, leaving one pooled backend with an empty search path and causing later migrations or seeds to fail intermittently with "no schema has been selected" or missing-relation errors. This commit configures PostgreSQL structure loads with `--single-transaction`, using Active Record's existing structure-loader flags to keep the restore on one PgBouncer backend and roll it back atomically on error. |
||
|---|---|---|
| .. | ||
| environments | ||
| imagemagick | ||
| initializers | ||
| locales | ||
| application.rb | ||
| boot.rb | ||
| cdn.yml.sample | ||
| database.yml | ||
| deploy.rb.sample | ||
| dev_defaults.yml | ||
| discourse.config.sample | ||
| discourse.pill.sample | ||
| discourse_defaults.conf | ||
| environment.rb | ||
| logrotate.conf | ||
| multisite.yml.production-sample | ||
| nginx.sample.conf | ||
| official_plugins.json | ||
| pitchfork.conf.rb | ||
| projections.json | ||
| routes.rb | ||
| sidekiq.yml | ||
| site_settings.yml | ||
| spring.rb | ||
| thin.yml.sample | ||
| unicorn_launcher | ||