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=4fdf23076c9e65a0cc3cba3f00947f65a65ec292;hpb=c6d74d3ead7c87c6c63997b8e39fa638f4851559;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Tag.pm b/t/lib/DBICTest/Schema/Tag.pm index 4fdf230..40bd945 100644 --- a/t/lib/DBICTest/Schema/Tag.pm +++ b/t/lib/DBICTest/Schema/Tag.pm @@ -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, @@ -15,9 +16,23 @@ DBICTest::Schema::Tag->add_columns( 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;