From: Peter Rabbitson Date: Thu, 29 Jan 2009 09:39:36 +0000 (+0000) Subject: Switch away the hook test from real tables (breaks DBICTEST_SQLT_DEPLOY=1) X-Git-Tag: v0.08011~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=34457a48d7741f2c862b472eac5d0e38368c9eb6;p=dbsrgits%2FDBIx-Class.git Switch away the hook test from real tables (breaks DBICTEST_SQLT_DEPLOY=1) --- diff --git a/t/86sqlt.t b/t/86sqlt.t index ad9c480..3108c3f 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -234,7 +234,7 @@ my %indexes = ( my $tschema = $translator->schema(); # Test that the $schema->sqlt_deploy_hook was called okay and that it removed # the 'link' table -ok( !defined($tschema->get_table('link')), "Link table was removed by hook"); +ok( !defined($tschema->get_table('dummy')), "Dummy table was removed by hook"); # Test that nonexistent constraints are not found my $constraint = get_constraint('FOREIGN KEY', 'cd', ['title'], 'cd', ['year']); diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index 1681cf5..5695a1f 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -33,6 +33,7 @@ __PACKAGE__->load_classes(qw/ 'ArtistSubclass', 'Producer', 'CD_to_Producer', + 'Dummy', ), qw/SelfRefAlias TreeLike TwoKeyTreeLike Event EventTZ NoPrimaryKey/, qw/Collection CollectionObject TypedObject/, @@ -43,7 +44,7 @@ __PACKAGE__->load_classes(qw/ sub sqlt_deploy_hook { my ($self, $sqlt_schema) = @_; - $sqlt_schema->drop_table('link'); + $sqlt_schema->drop_table('dummy'); } 1; diff --git a/t/lib/DBICTest/Schema/Dummy.pm b/t/lib/DBICTest/Schema/Dummy.pm new file mode 100644 index 0000000..6bc51d6 --- /dev/null +++ b/t/lib/DBICTest/Schema/Dummy.pm @@ -0,0 +1,23 @@ +package # hide from PAUSE + DBICTest::Schema::Dummy; + +use base 'DBIx::Class::Core'; + +use strict; +use warnings; + +__PACKAGE__->table('dummy'); +__PACKAGE__->add_columns( + 'id' => { + data_type => 'integer', + is_auto_increment => 1 + }, + 'gittery' => { + data_type => 'varchar', + size => 100, + is_nullable => 1, + }, +); +__PACKAGE__->set_primary_key('id'); + +1;