perl -Ilib -It/lib -MDBICTest::Schema -e'1'
Guillermo Roditi [Mon, 25 Aug 2008 17:52:56 +0000 (17:52 +0000)]
lib/DBIx/Class/ResultSource/View.pm
t/lib/DBICTest/Schema.pm
t/lib/DBICTest/Schema/Year2000CDs.pm [new file with mode: 0644]

index 7d6ec12..61c22b9 100644 (file)
@@ -8,12 +8,6 @@ use DBIx::Class::ResultSet;
 use base qw/DBIx::Class/;
 __PACKAGE__->load_components(qw/ResultSource/);
 
-
-  _columns _primaries _unique_constraints name resultset_attributes
-  schema from _relationships column_info_from_storage source_info
-  source_name/);
-
-
 =head1 NAME
 
 DBIx::Class::ResultSource::Table - Table object
index 22eddff..857c18c 100644 (file)
@@ -16,6 +16,7 @@ __PACKAGE__->load_classes(qw/
   #dummy
   Track
   Tag
+  Year2000CDs
   /,
   { 'DBICTest::Schema' => [qw/
     LinerNotes
diff --git a/t/lib/DBICTest/Schema/Year2000CDs.pm b/t/lib/DBICTest/Schema/Year2000CDs.pm
new file mode 100644 (file)
index 0000000..863263b
--- /dev/null
@@ -0,0 +1,25 @@
+package # hide from PAUSE 
+    DBICTest::Schema::Year2000CDs;
+
+use base 'DBIx::Class::Core::View';
+
+__PACKAGE__->view('cd');
+__PACKAGE__->view_definition("SELECT cdid, artist, title FROM cd WHERE year ='2000'");
+__PACKAGE__->add_columns(
+  'cdid' => {
+    data_type => 'integer',
+    is_auto_increment => 1,
+  },
+  'artist' => {
+    data_type => 'integer',
+  },
+  'title' => {
+    data_type => 'varchar',
+    size      => 100,
+  },
+
+);
+__PACKAGE__->set_primary_key('cdid');
+__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
+
+1;