From 8f52fe2b86500fd58ed9f63572765c6f9314bcc5 Mon Sep 17 00:00:00 2001 From: zby Date: Wed, 28 Jan 2009 15:09:23 +0000 Subject: [PATCH] added Viewing.pm --- t/lib/DBSchema/Result/Viewing.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 t/lib/DBSchema/Result/Viewing.pm diff --git a/t/lib/DBSchema/Result/Viewing.pm b/t/lib/DBSchema/Result/Viewing.pm new file mode 100755 index 0000000..13dcaa0 --- /dev/null +++ b/t/lib/DBSchema/Result/Viewing.pm @@ -0,0 +1,23 @@ +package DBSchema::Result::Viewing; +use base 'DBIx::Class::Core'; + +__PACKAGE__->table('viewing'); +__PACKAGE__->add_columns( + 'user_id' => { data_type => 'integer' }, + 'dvd_id' => { data_type => 'integer' }, +); +__PACKAGE__->set_primary_key(qw/user_id dvd_id/); + +__PACKAGE__->belongs_to( + user => 'DBSchema::Result::User', + {'foreign.id'=>'self.user_id'}, +); + +__PACKAGE__->belongs_to( + dvd => 'DBSchema::Result::Dvd', + {'foreign.id'=>'self.dvd_id'}, +); + +; + +1; -- 2.45.2