Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Tag.pm
index b93b622..40bd945 100644 (file)
@@ -1,12 +1,13 @@
-package # hide from PAUSE 
+package # hide from PAUSE
     DBICTest::Schema::Tag;
 
-use base qw/DBIx::Class::Core/;
+use warnings;
+use strict;
 
-__PACKAGE__->load_components('PK::Auto');
+use base qw/DBICTest::BaseResult/;
 
-DBICTest::Schema::Tag->table('tags');
-DBICTest::Schema::Tag->add_columns(
+__PACKAGE__->table('tags');
+__PACKAGE__->add_columns(
   'tagid' => {
     data_type => 'integer',
     is_auto_increment => 1,
@@ -19,6 +20,19 @@ DBICTest::Schema::Tag->add_columns(
     size      => 100,
   },
 );
-DBICTest::Schema::Tag->set_primary_key('tagid');
+__PACKAGE__->set_primary_key('tagid');
+
+__PACKAGE__->add_unique_constraints(  # do not remove, part of a test
+  tagid_cd     => [qw/ tagid cd /],
+  tagid_cd_tag => [qw/ tagid cd tag /],
+);
+__PACKAGE__->add_unique_constraints(  # do not remove, part of a test
+  [qw/ tagid tag /],
+  [qw/ tagid tag cd /],
+);
+
+__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', 'cd', {
+  proxy => [ 'year', { cd_title => 'title' } ],
+});
 
 1;