<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Mitchell,<br>
you've mistaken the direction of the relationship.<br>
The result class with the xxxid column should have a belongs_to relationship to ForeignClass with { join_type =&gt; &quot;LEFT&quot; } so that rows where the xxxid column is NULL won't be missing from the resultset if you're joining the relationship.<br>
<br>
In ForeignClass you could add a has_many relationship if you need it.<br>
<br>
BR Alex<br>
<br>
<div class="moz-cite-prefix">On 2014-06-05 13:54, Mitchell Elutovich wrote:<br>
</div>
<blockquote cite="mid:CAJO0H6t242ZmjrrAig7o_7UQtD=b3B&#43;EZFKt8PBZJdvw_enFNw@mail.gmail.com" type="cite">
<div dir="ltr">
<div>I have something like the following on a custom result source</div>
<div><br>
</div>
<div>
<div>__PACKAGE__-&gt;add_columns(</div>
<div>&nbsp; &quot;xxxid&quot;,<br>
</div>
<div>&nbsp; { data_type =&gt; &quot;INT&quot;, default_value =&gt; undef, is_nullable =&gt; 1, size =&gt; 11 },</div>
<div>);</div>
<div><br>
</div>
<div>__PACKAGE__-&gt;might_have(</div>
<div>&nbsp; &quot;xxxd&quot;,</div>
<div>&nbsp; &quot;ForeignClass&quot;,</div>
<div>&nbsp; { &quot;<a moz-do-not-send="true" href="http://foreign.id">foreign.id</a>&quot; =&gt; &quot;self.xxxid&quot; },</div>
<div>);</div>
<div><br>
</div>
</div>
<div>I'm getting the warning:</div>
<div><br>
</div>
<div>DBIx::Class::Relationship::HasOne::_validate_has_one_condition(): &quot;might_have/has_one&quot; must not be on columns with is_nullable set to true (MyClass/xxxid). This might indicate an incorrect use of those relationship helpers instead of belongs_to. at ...&nbsp;</div>
<div><br>
</div>
<div>I don't understand why this for might_have might be incorrect, doesn't might_have imply it might be null?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br>
<pre wrap="">_______________________________________________
List: <a class="moz-txt-link-freetext" href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a>
IRC: irc.perl.org#dbix-class
SVN: <a class="moz-txt-link-freetext" href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/">http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</a>
Searchable Archive: <a class="moz-txt-link-freetext" href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk">http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</a></pre>
</blockquote>
<br>
<br>
<font face="Verdana" color="Purple" size="2"><br>
*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*<br>
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien<br>
Handelsgericht Wien, FN 79340b<br>
*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*<br>
Notice: This e-mail contains information that is confidential and may be privileged.<br>
If you are not the intended recipient, please notify the sender and then<br>
delete this e-mail immediately.<br>
*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*&quot;*<br>
</font>
</body>
</html>