hi, i tried a similar stuff and here's what i'd do.
i wouldn't use movieID as pk, squeryl uses id of KeyedEntity in many places so i just follow the convention.
Notice that id has default value, that's cuz i want it be autoincremented (that's the default behavior)
class MovieSummary(val id: Long) extends KeyedEntity[Long]
Then in the schema:
object MySchema extend Schema {
val movies = table[Movie]
val movieSummaries = table[MovieSummary]
on(movieSummaries)(movieSummary => declare(
movieSummary.id is primaryKey //this turns off auto-increment for movieSummaries
))
//also make the primary key of movieSummary a foreign key to movies(id)
val movieToSummaries =
oneToManyRelation(movies, movieSummaries).
//More goodies: remove the summary when the movie is deleted
movieToSummaries.foreignKeyDeclaration.constrainReference(onDelete cascade)
}
However, now u have to provide the id of the movieToSummary whenever u create one.
But thats evident cuz u're just going to give it the id of the movie.
Hope this helps.