X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FTag.pm;h=40bd9456e9f3336a0decbd0f6f0c3f40986e8d4e;hb=4a233f3019d2baa4bf2abee0c873c74d5cdf3a11;hp=242d723dcb6b7474075c154fe6405d3c295ff086;hpb=a02675cd9a11e1f354220319da9f5d573a2e484a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Tag.pm b/t/lib/DBICTest/Schema/Tag.pm index 242d723..40bd945 100644 --- a/t/lib/DBICTest/Schema/Tag.pm +++ b/t/lib/DBICTest/Schema/Tag.pm @@ -1,13 +1,38 @@ -package DBICTest::Tag; +package # hide from PAUSE + DBICTest::Schema::Tag; -use base qw/DBIx::Class::Core/; +use warnings; +use strict; -DBICTest::Tag->table('tags'); -DBICTest::Tag->add_columns(qw/tagid cd tag/); -DBICTest::Tag->set_primary_key('tagid'); -DBICTest::Tag->add_relationship( - cd => 'DBICTest::CD', - { 'foreign.cdid' => 'self.cd' } +use base qw/DBICTest::BaseResult/; + +__PACKAGE__->table('tags'); +__PACKAGE__->add_columns( + 'tagid' => { + data_type => 'integer', + is_auto_increment => 1, + }, + 'cd' => { + data_type => 'integer', + }, + 'tag' => { + data_type => 'varchar', + size => 100, + }, +); +__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;