<div>I&#39;m trying to put last week&#39;s DBIC lecture to use and have most of the obvious stuff done. I&#39;m getting hung up by the error message: &quot;DBIx::Class::Schema::resultset(): Can&#39;t find source for Interface at ...&quot;. 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&#39;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-&gt;connect( ...redacted...);</div><div>my $row = $schema-&gt;resultset(&#39;ECCKT&#39;)-&gt;create({</div><div>   &#39;ecckt&#39;        =&gt; &#39;ABCD0123456ABCDEF&#39;,</div>

<div>   &#39;customer&#39;     =&gt; &#39;John Johnsonson&#39;,</div><div>   &#39;end&#39;          =&gt; 1269644794,</div><div>   &#39;interface&#39;    =&gt; &#39;GigabitEthernet10/1&#39;,</div><div>   &#39;last_updated&#39; =&gt; 1269644794,</div>

<div>   &#39;router&#39;       =&gt; &#39;<a href="http://ar11.slkcutxd.example.com">ar11.slkcutxd.example.com</a>&#39;,</div><div>   &#39;speed&#39;        =&gt; 1000000000,</div><div>   &#39;start&#39;        =&gt; 1265958902,</div>

<div>   &#39;state&#39;        =&gt; &#39;active&#39;,</div><div>});</div><div>$row-&gt;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 = &#39;0.01&#39;;</div><div><br></div><div>__PACKAGE__-&gt;load_namespaces();</div><div>__PACKAGE__-&gt;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__-&gt;table(&#39;ecckt&#39;);</div><div>__PACKAGE__-&gt;add_columns(</div><div>     ecckt_id =&gt; {</div>

<div>        data_type         =&gt; &#39;integer&#39;,</div><div>        size              =&gt; 8,</div><div>        is_nullable       =&gt; 0,</div><div>        is_auto_increment =&gt; 1,</div><div>    },</div><div>    ecckt =&gt; {</div>

<div>        data_type         =&gt; &#39;varchar&#39;,</div><div>        size              =&gt; 64,</div><div>        is_nullable       =&gt; 0,</div><div>    },</div><div>    if_id =&gt; {</div><div>        data_type         =&gt; &#39;integer&#39;,</div>

<div>        size              =&gt; 8,</div><div>        is_nullable       =&gt; 0,</div><div>        is_foreign_key    =&gt; 1,</div><div>    }</div><div>);</div><div>__PACKAGE__-&gt;set_primary_key(&#39;ecckt_id&#39;);</div>

<div>__PACKAGE__-&gt;has_many(&#39;interfaces&#39;, &#39;Integra::UBI::Schema::Result::Interface&#39;, &#39;if_id&#39;);</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__-&gt;table(&#39;interface&#39;);</div><div>__PACKAGE__-&gt;add_columns( </div><div>     if_id =&gt; {</div><div>        data_type         =&gt; &#39;integer&#39;,</div>

<div>        is_nullable       =&gt; 0,</div><div>        is_auto_increment =&gt; 1,</div><div>    },</div><div>    customer =&gt; {</div><div>        data_type         =&gt; &#39;varchar&#39;,</div><div>        size              =&gt; 256,</div>

<div>        is_nullable       =&gt; 1,</div><div>        default_value     =&gt; &#39;&#39;,</div><div>    },</div><div>    state =&gt; {</div><div>        data_type         =&gt; &#39;varchar&#39;,</div><div>        size              =&gt; 12,</div>

<div>        is_nullable       =&gt; 1,</div><div>    },</div><div>    router =&gt; {</div><div>        data_type         =&gt; &#39;varchar&#39;,</div><div>        size              =&gt; 128,</div><div>    },</div><div>

    interface =&gt; {</div><div>        data_type         =&gt; &#39;varchar&#39;,</div><div>        size              =&gt; 128,</div><div>    },</div><div>    speed =&gt; {</div><div>        data_type         =&gt; &#39;integer&#39;,</div>

<div>        is_nullable       =&gt; 1,</div><div>    },</div><div>    start =&gt; {</div><div>        data_type         =&gt; &#39;integer&#39;,</div><div>        is_nullable       =&gt; 1,</div><div>    },</div><div>    end =&gt; {</div>

<div>        data_type         =&gt; &#39;integer&#39;,</div><div>        is_nullable       =&gt; 1,</div><div>    },</div><div>    last_updated =&gt; {</div><div>        data_type         =&gt; &#39;integer&#39;,</div><div>

        is_nullable       =&gt; 1,</div><div>    },</div><div>    valid_router =&gt; {</div><div>        data_type         =&gt; &#39;tinyint&#39;,</div><div>        is_nullable       =&gt; 1,</div><div>    },</div><div>
    valid_it =&gt; {</div>
<div>        data_type         =&gt; &#39;tinyint&#39;,</div><div>        is_nullable       =&gt; 1,</div><div>    },</div><div>    ecckt_id =&gt; {</div><div>        data_type         =&gt; &#39;integer&#39;,</div><div>
        is_nullable       =&gt; 0,</div>
<div>        is_foreign_key    =&gt; 1,</div><div>    },</div><div>);</div><div>__PACKAGE__-&gt;set_primary_key(&#39;if_id&#39;);</div><div>__PACKAGE__-&gt;belongs_to(&#39;ecckt&#39;, &#39;Integra::UBI::Schema::Result::ECCKT&#39;, &#39;ecckt_id&#39;);</div>

<div><br></div><div>__END__</div>