{ order_by => 'producer.name' },
);
-__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre', { 'foreign.genreid' => 'self.genreid' });
+__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
+ { 'foreign.genreid' => 'self.genreid' },
+ { join_type => 'left' },
+);
#__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
# { 'foreign.genreid' => 'self.genreid' },
__PACKAGE__->belongs_to(
'producer', 'DBICTest::Schema::Producer',
- { 'foreign.producerid' => 'self.producer' }
+ { 'foreign.producerid' => 'self.producer' },
+ { on_delete => undef, on_update => undef },
);
1;
use base 'DBIx::Class::Core';
__PACKAGE__->table('genre');
-__PACKAGE__->add_columns(qw/genreid name/);
+__PACKAGE__->add_columns(
+ genreid => {
+ data_type => 'integer',
+ is_auto_increment => 1,
+ },
+ name => {
+ data_type => 'varchar',
+ size => 100,
+ },
+);
__PACKAGE__->set_primary_key('genreid');
+__PACKAGE__->add_unique_constraint ( genre_name => [qw/name/] );
-1;
-package DBICTest::Schema::Genre;
-
-use strict;
-
-use base 'DBIx::Class::Core';
-
-__PACKAGE__->table('genre');
-__PACKAGE__->add_columns(qw/genreid name/);
-__PACKAGE__->set_primary_key('genreid');
+__PACKAGE__->has_many (cds => 'DBICTest::Schema::CD', 'genreid');
1;
__PACKAGE__->set_primary_key('producerid');
__PACKAGE__->add_unique_constraint(prod_name => [ qw/name/ ]);
+__PACKAGE__->has_many(
+ producer_to_cd => 'DBICTest::Schema::CD_to_Producer' => 'producer'
+);
+
1;
--
-- Created by SQL::Translator::Producer::SQLite
--- Created on Thu Oct 9 13:44:56 2008
+-- Created on Fri Oct 24 14:20:32 2008
--
BEGIN TRANSACTION;
-- Table: genre
--
CREATE TABLE genre (
- genreid NOT NULL,
- name NOT NULL,
- PRIMARY KEY (genreid)
+ genreid INTEGER PRIMARY KEY NOT NULL,
+ name varchar(100) NOT NULL
);
+CREATE UNIQUE INDEX genre_name_genre ON genre (name);
--
-- Table: liner_notes