<div dir="ltr">Silly question, but could we just call our 'id' 'pk' instead? Since that is a fully reserved value in Django for the primary key it seems clearest to just use that? What about that?<br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 12, 2018 at 3:44 PM, Jeff Ortel <span dir="ltr"><<a href="mailto:jortel@redhat.com" target="_blank">jortel@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/08/2018 02:57 PM, Brian Bouterse wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
@jortel: We're blocked on your -1 vote expressed for 3704. We have practical plugin writer issues with the current state. Can you elaborate on why we shouldn't go forward with <a href="https://pulp.plan.io/issues/3704" rel="noreferrer" target="_blank">https://pulp.plan.io/issues/37<wbr>04</a><br>
</blockquote>
<br></span>
The 'ID' column is reserved for the primary key and is inappropriate for natural keys.  This is well establish convention and best practice. </blockquote><div><br></div><div>I don't understand this reasoning. Earlier in the thread we discussed how the sources recommending these conventions also mention that if we have a practical reason or problem with that convention to do something differently. We received complaints on this name about collisions so I don't follow how we should still follow the convention.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Plugin writers specify natural keys.  Also, by introducing '_' prefix (or any prefix) means a table could have both 'ID' and '_ID' columns which is especially confusing since the 'ID' column would not be the primary key.<br></blockquote><div><br></div><div>We have two concepts here that are similar, so I think that problem is mostly unrelated to this decision. For example, if we leave the names as-is we have this problem only now it's named id and errata_id and in addition we'll have the problems listed below.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
How does naming the natural key for an rpm as 'rpm_id' cause a significant problem for plugin writers?<br></blockquote><div><br></div><div></div><div>It's a good question because it's the whole motivation for this change. It's not an rpm, it's an erratum which doesn't have nevra like a package. It's also the problem from another content type I heard about at Config Management Camp.<br></div><div><br></div><div>It causes problems in two ways:</div><div><br></div><div>* plugin users (not writers) who are familiar with 'id' as part of the erratum data type would then have to also understand this field name renaming that Pulp arbitrarily introduces. This could get confusing when the user submit a filter with id='ID-2115858' and they find nothing because 'id' is matching on the primary key not on the 'id' attribute of the errata like they expect. Those users would also be Pulp users so they'll understand that _id means the pk.</div><div><br></div><div>* plugins specifically may wrap other tools and now they have to maintain mappings as well. This is specifically the case with errata which the data model is design to be name-for-name identical to the createrepo_c interface</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
@bmbouters: just curious, where does the rpm 'id' come from and how is it used differently than the NEVREA composite natural key.<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<wbr>_________________<br>
Pulp-dev mailing list<br>
<a href="mailto:Pulp-dev@redhat.com" target="_blank">Pulp-dev@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/pulp-dev</a><br>
</div></div></blockquote></div><br></div></div></div></div>