I've setup a Directus CMS project with 3 collections as follows:
I'd like to associate Movies and TV Shows with Actors in a multi-select ordered list. I've tried looking at the one-to-many relationship and some others and can't seem to figure out how to build this. Ideally I would like it to look roughly like:
Do I need an intermediary junction collection? Am I missing something obvious here?
From initial impressions Directus looks to be an awesome CMS!
you were on the right track, but the relationship type you are looking for is a "many-to-many" (or M2M). This is because a movie can have many actors, and actors can be in many movies.
You can see the Directus documentation for this relationship setup here:
https://docs.directus.io/guides/relationships.html#many-to-many
You will add two junction tables, something like actor_movies
and actor_tv_shows
, each with a schema like this:
id
— The primary key of the relationshipactor_id
— The foreign key that holds the actor idmovie_id
— The foreign key that holds the movie idTherefore, each record in these tables link an actor to a Movie or TV Show.