How to handle schemas polymorphism in Phoenix?

Are You sure You want to use polymorphism? It looks like Single Table Inheritance,

A PetOwner can have multiples animals, animals belongs to PetOwner. Animals can be cats, dogs, whatever.

Animals would have… id, pet_owner_id, type etc.

dogs is a subset of animals, as cats…

Also, it seems to be Phoenix 1.2, new version use Schema instead of Model?

There is a post about STI it here.

2 Likes