Approach #3: Use many_to_many
Explore the third approach to polymorphic associations in Ecto by using many_to_many. Learn how to set up a single notes table with join tables for multiple associations, understand its advantages and limitations compared to other methods, and practice adding notes to various schemas like Artist, Album, and Track.
A single notes table
The final approach to create polymorphic associations is to use many_to_many. With this approach, we create a single notes table, then add separate join tables for each of the different associations we want to use with notes. We would set this up the same way we did ...