Closed axeberg closed 6 years ago
genres:
php artisan make:migration create_genres_table --create=genres
$table->increments('id'); $table->string('genre_title')->nullable(); $table->timestamps();
genre_movie:
php artisan make:migration create_genre_movie_table --create=genre_movie
$table->increments('id'); $table->integer('genre_id')->unsigned(); $table->integer('movie_id')->unsigned(); $table->timestamps();
relationship (this goes in genre_movies table):
$table->foreign('genre_id')->references('genres')->on('id')->onDelete('cascade'); $table->foreign('movie_id')->references('movies')->on('id')->onDelete('cascade');
genres:
php artisan make:migration create_genres_table --create=genres
genre_movie:
php artisan make:migration create_genre_movie_table --create=genre_movie
relationship (this goes in genre_movies table):