Alright I’ll bite. So first off, let’s just establish that one single context can have more than one schema inside of it. So if you already have
mix phx.gen.context Cars Car car....
Now your application needs to deal with cars that come from an alternate universe, which have enough different details that you want to keep them in a different table, but they’re similar enough to our dimensional cars that you still want to use the Cars module to manage them. You could then do
mix phx.gen.context Cars CarFromAlternativeUniverse cars_from_alternative_universe...
OK, so what about your other example? Let’s say you now need to track who bought your cars, you could do
mix phx.gen.context Purchaser ManWomanChild men_women_children...
Now it’s also possible to have two schemas in two different contexts refer to the same database table. Let’s say our car application also wants to know, in addition to who purchased the car, who is the riders in the car for any given trip. We could create a Riders
context to handle all the logic around tracking riders, and then do
mix phx.gen.context Riders ManWomanChild men_women_children...
This now creates a new context which has a schema which refers to the same table that we created before. You can have some of the fields on the table exposed in the Purchaser schema, and some in the Riders schema. Your schema doesn’t need to have all of the fields that the table has. You can also safely refer to the same database fields from both the Riders and Purchaser schema.
Hope this helps! I’m still not certain on what exactly database structure you had in mind, so I’m not sure where cars_all
would fit in, but hopefully you can see how the schema, context, and database all relate from these examples.