<div>I'm trying to put last week's DBIC lecture to use and have most of the obvious stuff done. I'm getting hung up by the error message: "DBIx::Class::Schema::resultset(): Can't find source for Interface at ...". For the record, dbicadmin will generate the same error message (but still generate SQL.)</div>
<div><br></div><div>There are two tables: ECCKT and interface. An ECCKT is a circuit ID. Each ECCKT can have many interfaces.</div><div><br></div><div>I'm not finding much about fixing this particular error and the DBIC source code is a little dry for me to see how it relates.</div>
<div><br></div><div>Ideas?</div><div><br></div><div>Thanks,</div><div>Joshua</div><div><br></div><div>Source code from one script and three modules:</div><div><br></div><div>---------</div><div><br></div><div># This is the program that uses the DBIC schema:</div>
<div><br></div><div>use Integra::UBI::Schema;</div><div><br></div><div>my $schema = Integra::UBI::Schema->connect( ...redacted...);</div><div>my $row = $schema->resultset('ECCKT')->create({</div><div> 'ecckt' => 'ABCD0123456ABCDEF',</div>
<div> 'customer' => 'John Johnsonson',</div><div> 'end' => 1269644794,</div><div> 'interface' => 'GigabitEthernet10/1',</div><div> 'last_updated' => 1269644794,</div>
<div> 'router' => '<a href="http://ar11.slkcutxd.example.com">ar11.slkcutxd.example.com</a>',</div><div> 'speed' => 1000000000,</div><div> 'start' => 1265958902,</div>
<div> 'state' => 'active',</div><div>});</div><div>$row->update;</div><div><br></div><div>---------</div><div><br></div><div>package Integra::UBI::Schema;</div><div>use base qw/DBIx::Class::Schema/;</div>
<div><br></div><div>our $VERSION = '0.01';</div><div><br></div><div>__PACKAGE__->load_namespaces();</div><div>__PACKAGE__->load_components(qw/Schema::Versioned/);</div><div><br></div><div>---------</div><div>
<br></div><div>package Integra::UBI::Schema::Result::ECCKT;</div><div>use base qw/DBIx::Class::Core/;</div><div><br></div><div>__PACKAGE__->table('ecckt');</div><div>__PACKAGE__->add_columns(</div><div> ecckt_id => {</div>
<div> data_type => 'integer',</div><div> size => 8,</div><div> is_nullable => 0,</div><div> is_auto_increment => 1,</div><div> },</div><div> ecckt => {</div>
<div> data_type => 'varchar',</div><div> size => 64,</div><div> is_nullable => 0,</div><div> },</div><div> if_id => {</div><div> data_type => 'integer',</div>
<div> size => 8,</div><div> is_nullable => 0,</div><div> is_foreign_key => 1,</div><div> }</div><div>);</div><div>__PACKAGE__->set_primary_key('ecckt_id');</div>
<div>__PACKAGE__->has_many('interfaces', 'Integra::UBI::Schema::Result::Interface', 'if_id');</div><div><br></div><div>---------</div><div><br></div><div>package Integra::UBI::Schema::Result::Interface;</div>
<div>use base qw/DBIx::Class::Core/;</div><div><br></div><div>__PACKAGE__->table('interface');</div><div>__PACKAGE__->add_columns( </div><div> if_id => {</div><div> data_type => 'integer',</div>
<div> is_nullable => 0,</div><div> is_auto_increment => 1,</div><div> },</div><div> customer => {</div><div> data_type => 'varchar',</div><div> size => 256,</div>
<div> is_nullable => 1,</div><div> default_value => '',</div><div> },</div><div> state => {</div><div> data_type => 'varchar',</div><div> size => 12,</div>
<div> is_nullable => 1,</div><div> },</div><div> router => {</div><div> data_type => 'varchar',</div><div> size => 128,</div><div> },</div><div>
interface => {</div><div> data_type => 'varchar',</div><div> size => 128,</div><div> },</div><div> speed => {</div><div> data_type => 'integer',</div>
<div> is_nullable => 1,</div><div> },</div><div> start => {</div><div> data_type => 'integer',</div><div> is_nullable => 1,</div><div> },</div><div> end => {</div>
<div> data_type => 'integer',</div><div> is_nullable => 1,</div><div> },</div><div> last_updated => {</div><div> data_type => 'integer',</div><div>
is_nullable => 1,</div><div> },</div><div> valid_router => {</div><div> data_type => 'tinyint',</div><div> is_nullable => 1,</div><div> },</div><div>
valid_it => {</div>
<div> data_type => 'tinyint',</div><div> is_nullable => 1,</div><div> },</div><div> ecckt_id => {</div><div> data_type => 'integer',</div><div>
is_nullable => 0,</div>
<div> is_foreign_key => 1,</div><div> },</div><div>);</div><div>__PACKAGE__->set_primary_key('if_id');</div><div>__PACKAGE__->belongs_to('ecckt', 'Integra::UBI::Schema::Result::ECCKT', 'ecckt_id');</div>
<div><br></div><div>__END__</div>