I've found it a bit challenging to wrap my head around many-to-many associations in Ecto..
I just shared it here: https://news.ycombinator.com/item?id=25066424
Would recommend people checkout the list: https://alchemist.camp/episodes
I've been listening to the other person on the podcast (Justin Vincent) other podcast, Techzing, for many years.
See "Constraints and Upserts" as well as "Polymorphic associations with many to many".