package MyApp::Schema::Books; use strict; use warnings; use base 'DBIx::Class'; __PACKAGE__->load_components("Core"); __PACKAGE__->table("books"); __PACKAGE__->add_columns( "id", { data_type => "NUMBER", default_value => undef, is_nullable => 0, size => 38 }, "title", { data_type => "VARCHAR2", default_value => undef, is_nullable => 1, size => 100, }, "rating", { data_type => "NUMBER", default_value => undef, is_nullable => 1, size => 38 }, ); __PACKAGE__->set_primary_key("id"); # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-08-07 17:34:12 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t8NDS4p6epEhWCyorZl93Q # You can replace this text with custom content, and it will be preserved on regeneration # # Set relationships; # # has_many(): # args: # 1) Name of relationship, DBIC will create accessor with this name # 2) Name of the model class referenced by this relationship # 3) Column name in *foreign* table __PACKAGE__->has_many(book_authors => 'MyApp::Schema::BookAuthors', 'book_id'); # many_to_many(): # args: # 1) Name of relationship, DBIC will create accessor with this name # 2) Name of has_many() relationship this many_to_many() is shortcut for # 3) Name of belongs_to() relationship in model class of has_many() above # You must already have the has_many() defined to use a many_to_many(). __PACKAGE__->many_to_many(authors => 'book_authors', 'author'); 1;