chas-academy / dragons-06-imdb-clone

1 stars 3 forks source link

Model: Watchlists #132

Closed axeberg closed 6 years ago

axeberg commented 6 years ago

php artisan make:migration create_watchlists_table --create=watchlists

$table->increments('id');
$table->integer('movie_id')->unsigned();
$table->integer('user_id');
$table->boolean('watched')->default(false);
$table->timestamps();

Relation (in the same table):

$table->foreign('movie_id')->references('movies')->on('id')->onDelete('cascade');