No subject


Sun Nov 20 20:48:46 GMT 2022


```
On Tue, Jan 10, 2012 at 07:46:36AM -0500, Tim_Bunce via RT wrote:
> Tue Jan 10 07:46:34 2012: Request 73876 was acted upon.
> Transaction: Ticket created by TIMB
>        Queue: DBIx-Class
>      Subject: Optionally warn when a relationship is redefined [PATCH]
>    Broken in: (no value)
>     Severity: Unimportant
>        Owner: Nobody
>   Requestors: TIMB at cpan.org
>       Status: new
>  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=73876 >
> 
> 
> We've been using Schema::Loader for years on a large postgresql database. Over the years 
> we've had to add manual relationships to the generated schema files because S:L was missing 
> them for various reasons (often because they weren't declared in the database itself yet).
> 
> Now our schema is more complete and S:L is better at finding relationships and is adding 
> them to the generated schema files. However, they're being silently overridden by the manual 
> relationships we added previously.  The old manually added relationships are usually 
> incomplete and sometimes plain wrong.
> 

Newer versions of S::L are detecting such cases and issue the corresponding warnings.
If your S::L is upgraded, and you are not seeing those - this is a bug in S::L itself.

The other consideration to take is that silent overrides can happen on column accessors,
in adition to relationship accessors. S::L is supposed to detect this as well (also
it should detect static compile-time sub{}s).

As far as the patch is concerned - I am really wary of tying warn-toggle semantics
into DBIC_TRACE itself. I will be back on IRC next Monday, we can discuss options
then.

Cheers
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class-schema-loader/issues/49
You are receiving this because you are subscribed to this thread.

Message ID: <dbsrgits/dbix-class-schema-loader/issues/49 at github.com>
----==_mimepart_637a9364f016b_9013c67023282cd
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p></p>
<p dir="auto">Migrated from <a href="https://rt.cpan.org/Ticket/Display.html?id=73876" rel="nofollow">rt.cpan.org#73876</a> (status was 'open')</p>
<p dir="auto">Requestors:</p>
<ul dir="auto">
<li><a href="mailto:TIMB at cpan.org">TIMB at cpan.org</a></li>
</ul>
<p dir="auto">Attachments:</p>
<ul dir="auto">
<li><a href="https://rt.cpan.org/Ticket/Attachment/1020517/532214/dbix-class-rel-redef-warn.patch" rel="nofollow">dbix-class-rel-redef-warn.patch</a></li>
</ul>
<p dir="auto">From <a href="mailto:timb at cpan.org">timb at cpan.org</a> on 2012-01-10 12:46:34<br>
:</p>
<pre class="notranslate"><code class="notranslate">We've been using Schema::Loader for years on a large postgresql database. Over the years 
we've had to add manual relationships to the generated schema files because S:L was missing 
them for various reasons (often because they weren't declared in the database itself yet).

Now our schema is more complete and S:L is better at finding relationships and is adding 
them to the generated schema files. However, they're being silently overridden by the manual 
relationships we added previously.  The old manually added relationships are usually 
incomplete and sometimes plain wrong.

The attached patch makes it easy to identify redefined relationships. It carps is a relationship 
is redefined while DBIC_TRACE is set.

Some other env var or control mechanism could be used, I just picked DBIC_TRACE as an easy 
option. (I'd be happy if warnings were the default and were silenced by adding an attribute 
like is_redefintion=&gt;1 to the new relationship definition.)
</code></pre>
<p dir="auto">From <a href="mailto:rkitover at cpan.org">rkitover at cpan.org</a> on 2012-01-10 13:03:54<br>
:</p>
<pre class="notranslate"><code class="notranslate">Committed to topic/rel_redef_warn

</code></pre>
<p dir="auto">From <a href="mailto:ribasushi at leporine.io">ribasushi at leporine.io</a> on 2012-01-11 08:41:44<br>
:</p>
<pre class="notranslate"><code class="notranslate">On Tue, Jan 10, 2012 at 07:46:36AM -0500, Tim_Bunce via RT wrote:
&gt; Tue Jan 10 07:46:34 2012: Request 73876 was acted upon.
&gt; Transaction: Ticket created by TIMB
&gt;        Queue: DBIx-Class
&gt;      Subject: Optionally warn when a relationship is redefined [PATCH]
&gt;    Broken in: (no value)
&gt;     Severity: Unimportant
&gt;        Owner: Nobody
&gt;   Requestors: TIMB at cpan.org
&gt;       Status: new
&gt;  Ticket &lt;URL: https://rt.cpan.org/Ticket/Display.html?id=73876 &gt;
&gt; 
&gt; 
&gt; We've been using Schema::Loader for years on a large postgresql database. Over the years 
&gt; we've had to add manual relationships to the generated schema files because S:L was missing 
&gt; them for various reasons (often because they weren't declared in the database itself yet).
&gt; 
&gt; Now our schema is more complete and S:L is better at finding relationships and is adding 
&gt; them to the generated schema files. However, they're being silently overridden by the manual 
&gt; relationships we added previously.  The old manually added relationships are usually 
&gt; incomplete and sometimes plain wrong.
&gt; 

Newer versions of S::L are detecting such cases and issue the corresponding warnings.
If your S::L is upgraded, and you are not seeing those - this is a bug in S::L itself.

The other consideration to take is that silent overrides can happen on column accessors,
in adition to relationship accessors. S::L is supposed to detect this as well (also
it should detect static compile-time sub{}s).

As far as the patch is concerned - I am really wary of tying warn-toggle semantics
into DBIC_TRACE itself. I will be back on IRC next Monday, we can discuss options
then.

Cheers
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />Reply to this email directly, <a href="https://github.com/dbsrgits/dbix-class-schema-loader/issues/49">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AACJ4AS4VEU3VVCCC4E6ADDWJKFOJANCNFSM6AAAAAASGAWA5I">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AACJ4ARK3FCA5FZTSNX7DZ3WJKFOJA5CNFSM6AAAAAASGAWA5KWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHFNWFSKU.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span>&lt;dbsrgits/dbix-class-schema-loader/issues/49</span><span>@</span><span>github</span><span>.</span><span>com&gt;</span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/dbsrgits/dbix-class-schema-loader/issues/49",
"url": "https://github.com/dbsrgits/dbix-class-schema-loader/issues/49",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>
----==_mimepart_637a9364f016b_9013c67023282cd--



More information about the DBIx-Class-Devel mailing list