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=0a303d6b40efbd5dc090035505320386793a6a94;hpb=0009fa4905ab7f4585c4b470bfe049666bce8e17;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Tag.pm b/t/lib/DBICTest/Schema/Tag.pm index 0a303d6..40bd945 100644 --- a/t/lib/DBICTest/Schema/Tag.pm +++ b/t/lib/DBICTest/Schema/Tag.pm @@ -1,20 +1,38 @@ -package DBICTest::Schema::Tag; +package # hide from PAUSE + DBICTest::Schema::Tag; -use base qw/DBIx::Class::Core/; +use warnings; +use strict; -DBICTest::Schema::Tag->table('tags'); -DBICTest::Schema::Tag->add_columns( +use base qw/DBICTest::BaseResult/; + +__PACKAGE__->table('tags'); +__PACKAGE__->add_columns( 'tagid' => { - data_type => 'varchar', + data_type => 'integer', is_auto_increment => 1, }, 'cd' => { data_type => 'integer', }, 'tag' => { - data_type => 'varchar' + data_type => 'varchar', + 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;