3 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package My::Schema::Topic;
use strict;
use warnings;
use base qw/DBIx::Class/;
My::Schema::Topic->load_components(qw/ PK::Auto Core /);
My::Schema::Topic->table('topics');
My::Schema::Topic->add_columns(qw/topic_id topic/);
My::Schema::Topic->set_primary_key('topic_id');
My::Schema::Topic->has_many(boards => 'My::Schema::Board');
1;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package My::Schema::Board;
use strict;
use warnings;
use base qw/DBIx::Class/;
My::Schema::Board->load_components(qw/ PK::Auto Core /);
My::Schema::Board->table('boards');
My::Schema::Board->add_columns(qw/board_id topic_id title/);
My::Schema::Board->set_primary_key('board_id');
My::Schema::Board->belongs_to(topic => 'My::Schema::Topic',);
1;
QuoteDBIx::Class::Schema::throw_exception(): DBIx::Class::Row::throw_exception(): DBIx::Class::Relationship::HasMany::has_many(): No such column topic on foreign class My::Schema::Board (using our class name 'My::Schema::Topic' as foreign key) at My/Schema/Topic.pm line 12
1
2
My::Schema::Topic->has_many(boards => 'My::Schema::Board', 'board_id');
My::Schema::Board->belongs_to(topic => 'My::Schema::Topic', 'topic_id');
3 Einträge, 1 Seite |