From 934dd4d43a37359cff8a812fce912328aa0761a3 Mon Sep 17 00:00:00 2001 From: harvested Date: Sat, 27 Dec 2014 02:16:11 +0100 Subject: [PATCH] renamed table to `movie_genres`, adapted model acordingly, issue #2 --- lib/MyIMDB/Models/MovieGenres.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/MyIMDB/Models/MovieGenres.pm diff --git a/lib/MyIMDB/Models/MovieGenres.pm b/lib/MyIMDB/Models/MovieGenres.pm new file mode 100644 index 0000000..a789a7d --- /dev/null +++ b/lib/MyIMDB/Models/MovieGenres.pm @@ -0,0 +1,18 @@ +package MyIMDB::Models::MovieGenres; + +use strict; +use warnings; + +use base 'MyIMDB::Models::Object'; + +__PACKAGE__->set_up_table( + table => 'movies_genres', + columns => [ qw(movie_id genre_id) ], + pk_columns => [ qw(movie_id genre_id) ], + foreign_keys => [ qw(movies genres) ], +); + +#__PACKAGE__->has_a( movie_id => 'MyIMDB::Models::Movies' ); +#__PACKAGE__->has_a( genre_id => 'MyIMDB::Models::Genres' ); + +1;