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();
/,
{ 'DBICTest::Schema' => [qw/
LinerNotes
+ Artwork
+ Image
+ Lyrics
+ LyricVersion
OneKey
#dummy
TwoKeys
--- /dev/null
+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;
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',
--- /dev/null
+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;
--- /dev/null
+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;
--- /dev/null
+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;
__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;
--
-- 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;
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 (
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 (
--
+-- 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 (