You can find a tagging system example with Ecto upserts here…
https://hexdocs.pm/ecto/constraints-and-upserts.html