[Bast-commits] r5154 - in DBIx-Class/0.08/trunk/t: . lib
lib/DBICTest lib/DBICTest/Schema
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Mon Nov 17 01:59:53 GMT 2008
Author: ribasushi
Date: 2008-11-17 01:59:53 +0000 (Mon, 17 Nov 2008)
New Revision: 5154
Added:
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artwork.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Image.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/LyricVersion.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Lyrics.pm
Modified:
DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm
DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm
DBIx-Class/0.08/trunk/t/lib/sqlite.sql
Log:
Two more sets of might_have - has_many relationships for extra tests
Modified: DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t
===================================================================
--- DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t 2008-11-17 01:00:28 UTC (rev 5153)
+++ DBIx-Class/0.08/trunk/t/99dbic_sqlt_parser.t 2008-11-17 01:59:53 UTC (rev 5154)
@@ -9,7 +9,7 @@
eval "use DBD::mysql; use SQL::Translator 0.09;";
plan $@
? ( skip_all => 'needs SQL::Translator 0.09 for testing' )
- : ( tests => 102 );
+ : ( tests => 114 );
}
my $schema = DBICTest->init_schema();
Added: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artwork.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artwork.pm (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Artwork.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -0,0 +1,16 @@
+package # hide from PAUSE
+ DBICTest::Schema::Artwork;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table('cd_artwork');
+__PACKAGE__->add_columns(
+ 'cd_id' => {
+ data_type => 'integer',
+ },
+);
+__PACKAGE__->set_primary_key('cd_id');
+__PACKAGE__->belongs_to('cd', 'DBICTest::Schema::CD', 'cd_id');
+__PACKAGE__->has_many('images', 'DBICTest::Schema::Image', 'artwork_id');
+
+1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm 2008-11-17 01:00:28 UTC (rev 5153)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/CD.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -53,6 +53,8 @@
liner_notes => 'DBICTest::Schema::LinerNotes', undef,
{ proxy => [ qw/notes/ ] },
);
+__PACKAGE__->might_have(artwork => 'DBICTest::Schema::Artwork', 'cd_id');
+
__PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
__PACKAGE__->many_to_many(
producers_sorted => cd_to_producer => 'producer',
Added: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Image.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Image.pm (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Image.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -0,0 +1,28 @@
+package # hide from PAUSE
+ DBICTest::Schema::Image;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table('images');
+__PACKAGE__->add_columns(
+ 'id' => {
+ data_type => 'integer',
+ is_auto_increment => 1,
+ },
+ 'artwork_id' => {
+ data_type => 'integer',
+ is_foreign_key => 1,
+ },
+ 'name' => {
+ data_type => 'varchar',
+ size => 100,
+ },
+ 'data' => {
+ data_type => 'blob',
+ is_nullable => 1,
+ },
+);
+__PACKAGE__->set_primary_key('id');
+__PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_id');
+
+1;
Added: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/LyricVersion.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/LyricVersion.pm (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/LyricVersion.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -0,0 +1,24 @@
+package # hide from PAUSE
+ DBICTest::Schema::LyricVersion;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table('lyric_versions');
+__PACKAGE__->add_columns(
+ 'id' => {
+ data_type => 'integer',
+ is_auto_increment => 1,
+ },
+ 'lyric_id' => {
+ data_type => 'integer',
+ is_foreign_key => 1,
+ },
+ 'text' => {
+ data_type => 'varchar',
+ size => 100,
+ },
+);
+__PACKAGE__->set_primary_key('id');
+__PACKAGE__->belongs_to('lyric', 'DBICTest::Schema::Lyrics', 'lyric_id');
+
+1;
Added: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Lyrics.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Lyrics.pm (rev 0)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Lyrics.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -0,0 +1,21 @@
+package # hide from PAUSE
+ DBICTest::Schema::Lyrics;
+
+use base qw/DBIx::Class::Core/;
+
+__PACKAGE__->table('lyrics');
+__PACKAGE__->add_columns(
+ 'lyric_id' => {
+ data_type => 'integer',
+ is_auto_increment => 1,
+ },
+ 'track_id' => {
+ data_type => 'integer',
+ is_foreign_key => 1,
+ },
+);
+__PACKAGE__->set_primary_key('lyric_id');
+__PACKAGE__->belongs_to('track', 'DBICTest::Schema::Track', 'track_id');
+__PACKAGE__->has_many('lyric_versions', 'DBICTest::Schema::LyricVersion', 'lyric_id');
+
+1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm 2008-11-17 01:00:28 UTC (rev 5153)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -36,5 +36,6 @@
__PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd');
__PACKAGE__->might_have( cd_single => 'DBICTest::Schema::CD', 'single_track' );
+__PACKAGE__->might_have( lyrics => 'DBICTest::Schema::Lyrics', 'track_id' );
1;
Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm 2008-11-17 01:00:28 UTC (rev 5153)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema.pm 2008-11-17 01:59:53 UTC (rev 5154)
@@ -20,6 +20,10 @@
/,
{ 'DBICTest::Schema' => [qw/
LinerNotes
+ Artwork
+ Image
+ Lyrics
+ LyricVersion
OneKey
#dummy
TwoKeys
Modified: DBIx-Class/0.08/trunk/t/lib/sqlite.sql
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/sqlite.sql 2008-11-17 01:00:28 UTC (rev 5153)
+++ DBIx-Class/0.08/trunk/t/lib/sqlite.sql 2008-11-17 01:59:53 UTC (rev 5154)
@@ -1,6 +1,6 @@
--
-- Created by SQL::Translator::Producer::SQLite
--- Created on Sun Nov 16 10:43:11 2008
+-- Created on Mon Nov 17 02:53:11 2008
--
BEGIN TRANSACTION;
@@ -29,6 +29,15 @@
CREATE INDEX artist_undirected_map_idx_id2_ ON artist_undirected_map (id2);
--
+-- Table: cd_artwork
+--
+CREATE TABLE cd_artwork (
+ cd_id INTEGER PRIMARY KEY NOT NULL
+);
+
+CREATE INDEX cd_artwork_idx_cd_id_cd_artwor ON cd_artwork (cd_id);
+
+--
-- Table: bookmark
--
CREATE TABLE bookmark (
@@ -185,6 +194,18 @@
CREATE UNIQUE INDEX genre_name_genre ON genre (name);
--
+-- Table: images
+--
+CREATE TABLE images (
+ id INTEGER PRIMARY KEY NOT NULL,
+ artwork_id integer NOT NULL,
+ name varchar(100) NOT NULL,
+ data blob
+);
+
+CREATE INDEX images_idx_artwork_id_images ON images (artwork_id);
+
+--
-- Table: liner_notes
--
CREATE TABLE liner_notes (
@@ -205,6 +226,27 @@
--
+-- Table: lyric_versions
+--
+CREATE TABLE lyric_versions (
+ id INTEGER PRIMARY KEY NOT NULL,
+ lyric_id integer NOT NULL,
+ text varchar(100) NOT NULL
+);
+
+CREATE INDEX lyric_versions_idx_lyric_id_ly ON lyric_versions (lyric_id);
+
+--
+-- Table: lyrics
+--
+CREATE TABLE lyrics (
+ lyric_id INTEGER PRIMARY KEY NOT NULL,
+ track_id integer NOT NULL
+);
+
+CREATE INDEX lyrics_idx_track_id_lyrics ON lyrics (track_id);
+
+--
-- Table: noprimarykey
--
CREATE TABLE noprimarykey (
More information about the Bast-commits
mailing list