Quentin wants to create a new in-memory SQLite database that contains the actors and movies tables and set up a many-to-many relationship between them.
The actors table should have the following columns:
| actors | |
|---|---|
id |
INTEGER, PK |
created_at |
DATETIME |
updated_at |
DATETIME |
deleted_at |
DATETIME |
first_name |
TEXT |
last_name |
TEXT |
birth_date |
DATETIME |
The movies table should have the following columns:
| movies | |
|---|---|
id |
INTEGER, PK |
created_at |
DATETIME |
updated_at |
DATETIME |
deleted_at |
DATETIME |
title |
TEXT |
release_date |
DATETIME |
And the actor_movies join table (which is automatically created by GORM) should have the following columns:
| actor_movies | |
|---|---|
actor_id |
INTEGER, FK(actors) |
movie_id |
INTEGER, FK(movies) |
Your task is to help Quentin write the required code to declare the Actor and Movie models, using the gorm.Model struct, and use the `gorm:"many2many:..."` struct tag to set up the many-to-many relationship between Actor and Movie and create the actor_movies join table.
This problem uses the reflect package and the hidden function
checkModels() to check if you correctly declared the Actor and Movie models and set up a many-to-many relationship between them.