]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blobdiff - t/lib/DBSchema/Result/Viewing.pm
added Viewing.pm
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / 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 (executable)
index 0000000..13dcaa0
--- /dev/null
@@ -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;
This page took 0.017713 seconds and 4 git commands to generate.