Given Rails issues like https://github.com/rails/rails/issues/36921 and projects like https://github.com/SchemaPlus/schema_plus_enums, it seems like there’s a real desire to use Postgres custom types in Rails without having to resort to structure.sql
. (structure.sql
support has gotten a lot better, but it’s still vulnerable to e.g. nonsense churn caused by folks running different DB versions locally.)
Other Postgres-specific features, such as foreign data wrappers, are near-unusable within Rails when you’re committing your schema – schema.rb
ignores them, and structure.sql
encodes information that should never be committed, like database passwords.
I don’t think that Rails maintainers should be obligated to maintain schema.rb
dumpers for a lot of different, esoteric database-specific features. But right now, if you want to extend schema.rb
’s functionality, you need to monkeypatch Rails internals; it’s fragile when upgrading.
I’d like there to be a stable, external-facing interface allowing folks to extend schema.rb
dumpers with database-specific features, without monkeypatching. I’m happy to take on the work of implementing this, but I wanted to raise this as an issue first so that if the core team isn’t interested in this as a feature no work is wasted.