Rails Daily: PostgreSQL Schema Fixes and Test Cleanup
Four pull requests were merged addressing PostgreSQL schema dumping issues and test database cleanup. The changes fix schema qualification problems for index opclasses and enum types while improving test isolation.
Duration: PT1M46S
Transcript
Good morning, this is Rails Daily for May 26th, 2026.
Four pull requests were merged yesterday, primarily addressing PostgreSQL schema handling and test infrastructure improvements.
Yahonda merged a significant test cleanup fix that makes `use_postgresql` and `use_mysql2` test helpers automatically drop per-process databases when given a block. This addresses a longstanding issue where parallel test databases were left behind because `rails db:drop` only drops databases listed in `config/database.yml`. The change affects 166 lines across 6 railties test files.
Nicolas Vaillant fixed a PostgreSQL schema dumping bug where index opclasses were silently dropped from `schema.rb` when using persistent schemas alongside `dump_schemas`. The issue occurred when extensions like `pg_trgm` were installed in separate schemas, causing schema-qualified opclass names to be filtered out by a regex that didn't account for dots in names.
Fatkodima merged a rework addressing PostgreSQL enum types, ensuring they're dumped with fully qualified names. This resolves schema qualification issues similar to the index opclass problem.
Yahonda also cleaned up a process leak in `FullStackConsoleTest` where `rails console` subprocesses spawned via `Process.spawn` were never properly terminated, leaving dozens of hanging processes after test runs.
What's next: These PostgreSQL schema improvements should resolve several edge cases developers encountered when using multiple schemas or extensions. The test cleanup changes will make parallel test runs more reliable and prevent resource leaks.
That's your Rails update for today. I'm back tomorrow with more from the Rails repository.