From: Aran Deltac Date: Tue, 23 May 2006 13:23:45 +0000 (+0000) Subject: Merge 'DBIx-Class-current' into 'reorganize_tests' X-Git-Tag: v0.07002~75^2~165^2~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d904c338280461a590bfb2f9b2351bcb66d0725b;p=dbsrgits%2FDBIx-Class.git Merge 'DBIx-Class-current' into 'reorganize_tests' r1664@moss (orig r1663): matthewt | 2006-05-18 06:19:02 -0700 r8675@cain (orig r1649): castaway | 2006-05-17 09:28:27 +0000 Documentation updates r8676@cain (orig r1650): zarquon | 2006-05-17 09:49:18 +0000 optimised last_insert_id example for searching r8691@cain (orig r1659): castaway | 2006-05-18 09:48:30 +0000 Add pod for params of inflate/deflate coderefs r1678@moss (orig r1677): tomk | 2006-05-18 10:13:14 -0700 Moved UUIDColumns from DBIX-Class-current into it's own dist in the trunk r1679@moss (orig r1678): matthewt | 2006-05-18 10:36:48 -0700 Moved PK::Auto into core r1703@moss (orig r1702): castaway | 2006-05-19 13:26:38 -0700 zbys Postgres casecheck patch r1704@moss (orig r1703): jguenther | 2006-05-19 13:50:55 -0700 added ensure_class_loaded method to Componentized, which should fix problems with nonexistent classes referenced in relationships going undetected r1705@moss (orig r1704): jguenther | 2006-05-19 13:56:32 -0700 removed DBICTest::Schema::Casecheck until someone adds it r1716@moss (orig r1715): matthewt | 2006-05-19 17:34:58 -0700 r8698@cain (orig r1666): tomk | 2006-05-18 15:56:54 +0000 Moved UUIDColumns.pm over from main DBIx::Class dist r8699@cain (orig r1667): tomk | 2006-05-18 15:59:52 +0000 Moved UUIDMaker.pm over from main DBIx::Class dist r8707@cain (orig r1675): tomk | 2006-05-18 16:49:41 +0000 Undoing changes commited in revisions 1664-1671... Sorry for the fuck up r8718@cain (orig r1681): jguenther | 2006-05-18 18:32:06 +0000 added bind information to exception thrown from DBIx::Class::Storage::DBI::_execute() r8731@cain (orig r1684): jguenther | 2006-05-18 21:55:45 +0000 removed another couple extraneous $self->dbh calls r8732@cain (orig r1685): jguenther | 2006-05-18 22:11:20 +0000 fixed small error in the SYNOPSIS of ResultSetManager.pm r8733@cain (orig r1686): jguenther | 2006-05-18 22:34:31 +0000 fixed an out-of-date limitation for has_many prefetch mentioned in Cookbook.pm r8741@cain (orig r1694): castaway | 2006-05-19 12:42:20 +0000 Update VERSION r8742@cain (orig r1695): castaway | 2006-05-19 13:03:20 +0000 Oops, fix bookmark thingy here too r8743@cain (orig r1696): castaway | 2006-05-19 13:12:22 +0000 .. And correct the number of tests r1719@moss (orig r1718): matthewt | 2006-05-19 17:53:52 -0700 r1656@cain (orig r1519): matthewt | 2006-04-26 03:19:25 +0000 Added InflateColumn::DateTime component r1720@moss (orig r1719): matthewt | 2006-05-19 17:54:25 -0700 r8669@cain (orig r1643): matthewt | 2006-05-17 00:22:06 +0000 Missing stuff for DateTime branch r1721@moss (orig r1720): matthewt | 2006-05-19 17:54:29 -0700 r1722@moss (orig r1721): matthewt | 2006-05-19 17:54:33 -0700 r1723@moss (orig r1722): matthewt | 2006-05-19 17:54:37 -0700 r8762@cain (orig r1713): matthewt | 2006-05-20 00:33:14 +0000 added datetime parser types for the dbs I can find them for r1724@moss (orig r1723): matthewt | 2006-05-19 17:54:41 -0700 r8763@cain (orig r1714): matthewt | 2006-05-20 00:34:39 +0000 added datetime parser for MSSQL (ta LTJake) r1725@moss (orig r1724): matthewt | 2006-05-19 17:54:44 -0700 r1726@moss (orig r1725): matthewt | 2006-05-19 18:14:38 -0700 futz changes, fix populate. I'm a retard. r1731@moss (orig r1730): claco | 2006-05-20 13:40:55 -0700 Added delete_related tests to verify it only deletes related records --- d904c338280461a590bfb2f9b2351bcb66d0725b diff --cc t/lib/DBICTest/Schema.pm index 8de3ba9,1fd503c..aff1d00 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@@ -31,150 -32,7 +32,150 @@@ __PACKAGE__->load_classes(qw 'Producer', 'CD_to_Producer', ), - qw/SelfRefAlias TreeLike TwoKeyTreeLike/ + qw/SelfRefAlias TreeLike TwoKeyTreeLike Event/ ); +sub deploy { + my $self = shift; + + if ($ENV{"DBICTEST_SQLT_DEPLOY"}) { + return $schema->next::method(@_); + } else { + open IN, "t/lib/sqlite.sql"; + my $sql; + { local $/ = undef; $sql = ; } + close IN; + $self->storage->dbh->do($_) for split(/;\n/, $sql); + } +} + +sub auto_populate { + my $self = shift; + + $self->storage->dbh->do("PRAGMA synchronous = OFF"); + + $self->populate('Artist', [ + [ qw/artistid name/ ], + [ 1, 'Caterwauler McCrae' ], + [ 2, 'Random Boy Band' ], + [ 3, 'We Are Goth' ], + ]); + + $self->populate('CD', [ + [ qw/cdid artist title year/ ], + [ 1, 1, "Spoonful of bees", 1999 ], + [ 2, 1, "Forkful of bees", 2001 ], + [ 3, 1, "Caterwaulin' Blues", 1997 ], + [ 4, 2, "Generic Manufactured Singles", 2001 ], + [ 5, 3, "Come Be Depressed With Us", 1998 ], + ]); + + $self->populate('LinerNotes', [ + [ qw/liner_id notes/ ], + [ 2, "Buy Whiskey!" ], + [ 4, "Buy Merch!" ], + [ 5, "Kill Yourself!" ], + ]); + + $self->populate('Tag', [ + [ qw/tagid cd tag/ ], + [ 1, 1, "Blue" ], + [ 2, 2, "Blue" ], + [ 3, 3, "Blue" ], + [ 4, 5, "Blue" ], + [ 5, 2, "Cheesy" ], + [ 6, 4, "Cheesy" ], + [ 7, 5, "Cheesy" ], + [ 8, 2, "Shiny" ], + [ 9, 4, "Shiny" ], + ]); + + $self->populate('TwoKeys', [ + [ qw/artist cd/ ], + [ 1, 1 ], + [ 1, 2 ], + [ 2, 2 ], + ]); + + $self->populate('FourKeys', [ + [ qw/foo bar hello goodbye/ ], + [ 1, 2, 3, 4 ], + [ 5, 4, 3, 6 ], + ]); + + $self->populate('OneKey', [ + [ qw/id artist cd/ ], + [ 1, 1, 1 ], + [ 2, 1, 2 ], + [ 3, 2, 2 ], + ]); + + $self->populate('SelfRef', [ + [ qw/id name/ ], + [ 1, 'First' ], + [ 2, 'Second' ], + ]); + + $self->populate('SelfRefAlias', [ + [ qw/self_ref alias/ ], + [ 1, 2 ] + ]); + + $self->populate('ArtistUndirectedMap', [ + [ qw/id1 id2/ ], + [ 1, 2 ] + ]); + + $self->populate('Producer', [ + [ qw/producerid name/ ], + [ 1, 'Matt S Trout' ], + [ 2, 'Bob The Builder' ], + [ 3, 'Fred The Phenotype' ], + ]); + + $self->populate('CD_to_Producer', [ + [ qw/cd producer/ ], + [ 1, 1 ], + [ 1, 2 ], + [ 1, 3 ], + ]); + + $self->populate('TreeLike', [ + [ qw/id parent name/ ], + [ 1, 0, 'foo' ], + [ 2, 1, 'bar' ], + [ 3, 2, 'baz' ], + [ 4, 3, 'quux' ], + ]); + + $self->populate('Track', [ + [ qw/trackid cd position title/ ], + [ 4, 2, 1, "Stung with Success"], + [ 5, 2, 2, "Stripy"], + [ 6, 2, 3, "Sticky Honey"], + [ 7, 3, 1, "Yowlin"], + [ 8, 3, 2, "Howlin"], + [ 9, 3, 3, "Fowlin"], + [ 10, 4, 1, "Boring Name"], + [ 11, 4, 2, "Boring Song"], + [ 12, 4, 3, "No More Ideas"], + [ 13, 5, 1, "Sad"], + [ 14, 5, 2, "Under The Weather"], + [ 15, 5, 3, "Suicidal"], + [ 16, 1, 1, "The Bees Knees"], + [ 17, 1, 2, "Apiary"], + [ 18, 1, 3, "Beehind You"], + ]); + + $self->populate('Link', [ + [ qw/id title/ ], + [ 1, 'aaa' ] + ]); + + $self->populate('Bookmark', [ + [ qw/id link/ ], + [ 1, 1 ] + ]); +} + 1;