[Feature] Allow no-monkeypatching extension of schema.rb builder

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Feature] Allow no-monkeypatching extension of schema.rb builder

Betsy Haibel

Per issues like #36921 and projects like https://github.com/SchemaPlus/schema_plus_enums, it seems like a lot of folks want 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, as a project, should necessarily be in the business of maintaining 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. That makes extensions fragile when upgrading, and discourages both potential and actual gem authors from sticking with their gems for the long haul.


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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/9af705a4-29f6-48c6-95da-28b7e3cd61bc%40googlegroups.com.