On 05/29/2018 08:24 AM, Brian Bouterse wrote:
On Fri, May 25, 2018 at 7:39 PM, Dana Walker <dawal...@redhat.com <mailto:dawal...@redhat.com>> wrote:

    I'm basically -1 for the reasons Jeff enumerated but if he is ok
    with this, I'm happy to go ahead with it.

        [Jeff]:
        In classic relational modeling, using ID as the primary key is
        common practice.  Especially when ORMs are involved.  The "id"
        added by plugin writers is a natural key so naming it ID goes
        against convention.


    This is echoed here, for further reading (though perhaps this
    article is overly simplified for our needs) in the sections "Key
    Fields" and "Prefixes and Suffixes (are bad)":
    https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/
    <https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/>


That is true, but this article also talks about avoiding reserved words as well. I think we're hearing 'id' is a commonly reserved word for content types being modeled by plugin writers.


The article[1] you mentioned states that 'ID' /should/ be used for the PK which means it is inappropriate for natural key fields defined by plugin writers.  The reserved words caution in the article are DDL/DML reserved words "Ex: Avoid using words like |user|, |lock|, or |table|." not reserved by plugins.

[1] https://launchbylunch.com/posts/2014/Feb/16/sql-naming-conventions/#primary-keys
_______________________________________________
Pulp-dev mailing list
Pulp-dev@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-dev

Reply via email to