mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-28 20:18:53 +08:00
PostgreSQL refuses to run initdb/pg_ctl as root. When TemporaryDb detects it is running as root, it now delegates all PG commands to the postgres system user via sudo. This fixes the migration-tests CI workflow where the schema validation step runs as root. Also adds a PATH-based fallback for pg_bin_path discovery to support distributions that install PG binaries outside the hardcoded paths (e.g. Fedora system packages in /usr/bin). --------- Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org> |
||
|---|---|---|
| .. | ||
| bin | ||
| config | ||
| db | ||
| docs | ||
| lib | ||
| scripts/benchmarks | ||
| spec | ||
| .gitignore | ||
| .reek.yml | ||
| .rubocop.yml | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| migrations.rb | ||
| README.md | ||
Migrations Tooling
Command line interface
./bin/cli help
Converters
Public converters are stored in lib/converters/.
If you need to run a private converter, put its code into a subdirectory of private/converters/
Development
Installing gems
bundle config set --local with migrations
bundle install
Updating gems
bundle update --group migrations
Running tests
You need to execute rspec in the root of the project.
bin/rspec --default-path migrations/spec