Ruby on Rails: PostgreSQL Schema Improvements and Test Cleanup
Four pull requests were merged addressing PostgreSQL schema handling issues and test database cleanup. Key fixes include proper index opclass preservation and enum type dumping with fully qualified names.
Duration: PT1M46S
Transcript
Good morning, this is your Rails development update for May 26th, 2026.
Four significant pull requests were merged over the weekend, with a focus on PostgreSQL improvements and test infrastructure cleanup.
Yahonda merged two important testing infrastructure fixes. The first addresses test database cleanup by making `use_postgresql` and `use_mysql2` helpers automatically drop per-process databases created during testing. This prevents leftover databases that aren't cleaned up by standard Rails commands. The second fix resolves a process leak in console tests where Rails console subprocesses were spawned but never properly terminated.
On the PostgreSQL front, nicolasva merged a fix for schema dumping that was silently dropping index opclasses when using persistent schemas. The issue occurred when extensions like pg_trgm were installed in separate schemas, causing schema-qualified opclass names to be dropped from schema.rb files due to regex matching problems.
Fatkodima also merged improvements to PostgreSQL enum handling, ensuring enum types are dumped with fully qualified names in schema files. This addresses consistency issues when working with enums across different database schemas.
The merged changes span 213 lines added and 107 lines removed across 11 files, primarily in ActiveRecord's PostgreSQL adapters and Railties testing infrastructure.
What's next: These fixes should improve PostgreSQL schema reliability for applications using multiple schemas and reduce test suite overhead from leaked processes and databases.
That's your Rails update for today. We'll be back tomorrow with more development news.