Modularizing Database Schema in `packs-rails`: Is it Possible?

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Message originally sent by slack user U71810IPUMS

Thanks everyone for all the help y’all have giving. I think I am gaining support. A question came up during my demo of packs-rails. Is it possible to modularize the database schema?

I am not aware of anyone having tried to do that. I suspect one would be fighting a lot of tools’ assumptions about schema.rb being a singleton.

That said, I have for a long time wished for another protection in rubocop-packs: Allow a package to add a rule of it using a separate DB connection exclusively. This, when reaching no violations, would prevent associations between models in the pack and those in other packs

I have no idea if anyone has done this already, but schema.rb is effectively a ruby file, isn’t it?

What would prevent us from loading all db/schema.rb files from components and require them inside the block :thinking_face: ?

This would be effectively the same as routes

“theoretically speaking” :grimacing:

Message originally sent by slack user U71810IPUMS

That was my thought as well. It sounds theoretically possible but I am too new to this to decide it this is a bad idea.

Message excluded from import.

Message excluded from import.

Message excluded from import.