[Bast-commits] r5183 - in DBIx-Class/0.08/branches/multicreate/t: .
lib lib/DBICTest lib/DBICTest/Schema
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Sun Nov 23 12:50:46 GMT 2008
Author: ribasushi
Date: 2008-11-23 12:50:46 +0000 (Sun, 23 Nov 2008)
New Revision: 5183
Added:
DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork_to_Artist.pm
Modified:
DBIx-Class/0.08/branches/multicreate/t/99dbic_sqlt_parser.t
DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema.pm
DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artist.pm
DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork.pm
DBIx-Class/0.08/branches/multicreate/t/lib/sqlite.sql
Log:
Yet another test relationship/table for the real test by castaway
Modified: DBIx-Class/0.08/branches/multicreate/t/99dbic_sqlt_parser.t
===================================================================
--- DBIx-Class/0.08/branches/multicreate/t/99dbic_sqlt_parser.t 2008-11-23 11:13:24 UTC (rev 5182)
+++ DBIx-Class/0.08/branches/multicreate/t/99dbic_sqlt_parser.t 2008-11-23 12:50:46 UTC (rev 5183)
@@ -9,7 +9,7 @@
eval "use DBD::mysql; use SQL::Translator 0.09;";
plan $@
? ( skip_all => 'needs SQL::Translator 0.09 for testing' )
- : ( tests => 114 );
+ : ( tests => 117 );
}
my $schema = DBICTest->init_schema();
Modified: DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artist.pm
===================================================================
--- DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artist.pm 2008-11-23 11:13:24 UTC (rev 5182)
+++ DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artist.pm 2008-11-23 12:50:46 UTC (rev 5183)
@@ -53,6 +53,12 @@
{ cascade_copy => 0 } # this would *so* not make sense
);
+__PACKAGE__->has_many(
+ artist_to_artwork => 'DBICTest::Schema::Artwork_to_Artist' => 'artist_id'
+);
+__PACKAGE__->many_to_many('artworks', 'artist_to_artwork', 'artwork');
+
+
sub sqlt_deploy_hook {
my ($self, $sqlt_table) = @_;
Modified: DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork.pm
===================================================================
--- DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork.pm 2008-11-23 11:13:24 UTC (rev 5182)
+++ DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork.pm 2008-11-23 12:50:46 UTC (rev 5183)
@@ -1,4 +1,4 @@
-package # hide from PAUSE
+package # hide from PAUSE
DBICTest::Schema::Artwork;
use base qw/DBIx::Class::Core/;
@@ -13,4 +13,7 @@
__PACKAGE__->belongs_to('cd', 'DBICTest::Schema::CD', 'cd_id');
__PACKAGE__->has_many('images', 'DBICTest::Schema::Image', 'artwork_id');
+__PACKAGE__->has_many('artwork_to_artist', 'DBICTest::Schema::Artwork_to_Artist', 'artwork_cd_id');
+__PACKAGE__->many_to_many('artists', 'artwork_to_artist', 'artist');
+
1;
Added: DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork_to_Artist.pm
===================================================================
--- DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork_to_Artist.pm (rev 0)
+++ DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema/Artwork_to_Artist.pm 2008-11-23 12:50:46 UTC (rev 5183)
@@ -0,0 +1,21 @@
+package # hide from PAUSE
+ DBICTest::Schema::Artwork_to_Artist;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table('artwork_to_artist');
+__PACKAGE__->add_columns(
+ 'artwork_cd_id' => {
+ data_type => 'integer',
+ is_foreign_key => 1,
+ },
+ 'artist_id' => {
+ data_type => 'integer',
+ is_foreign_key => 1,
+ },
+);
+__PACKAGE__->set_primary_key(qw/artwork_cd_id artist_id/);
+__PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
+__PACKAGE__->belongs_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
+
+1;
Modified: DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema.pm
===================================================================
--- DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema.pm 2008-11-23 11:13:24 UTC (rev 5182)
+++ DBIx-Class/0.08/branches/multicreate/t/lib/DBICTest/Schema.pm 2008-11-23 12:50:46 UTC (rev 5183)
@@ -21,6 +21,7 @@
{ 'DBICTest::Schema' => [qw/
LinerNotes
Artwork
+ Artwork_to_Artist
Image
Lyrics
LyricVersion
Modified: DBIx-Class/0.08/branches/multicreate/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/branches/multicreate/t/lib/sqlite.sql 2008-11-23 11:13:24 UTC (rev 5182)
+++ DBIx-Class/0.08/branches/multicreate/t/lib/sqlite.sql 2008-11-23 12:50:46 UTC (rev 5183)
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
--- Created on Mon Nov 17 02:53:11 2008
+-- Created on Sun Nov 23 13:27:13 2008
--
BEGIN TRANSACTION;
@@ -38,6 +38,18 @@
CREATE INDEX cd_artwork_idx_cd_id_cd_artwor ON cd_artwork (cd_id);
--
+-- Table: artwork_to_artist
+--
+CREATE TABLE artwork_to_artist (
+ artwork_cd_id integer NOT NULL,
+ artist_id integer NOT NULL,
+ PRIMARY KEY (artwork_cd_id, artist_id)
+);
+
+CREATE INDEX artwork_to_artist_idx_artist_id_artwork_to_arti ON artwork_to_artist (artist_id);
+CREATE INDEX artwork_to_artist_idx_artwork_cd_id_artwork_to_ ON artwork_to_artist (artwork_cd_id);
+
+--
-- Table: bookmark
--
CREATE TABLE bookmark (
More information about the Bast-commits
mailing list