{"id":1441,"date":"2011-09-30T09:01:25","date_gmt":"2011-09-30T16:01:25","guid":{"rendered":"http:\/\/juixe.com\/techknow\/?p=1441"},"modified":"2011-09-28T22:12:32","modified_gmt":"2011-09-29T05:12:32","slug":"avoid-overloading-meaning-to-existing-database-column","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2011\/09\/30\/avoid-overloading-meaning-to-existing-database-column\/","title":{"rendered":"Avoid overloading Meaning to Existing Database Column"},"content":{"rendered":"<p>I&#8217;ve always found that when defining a database table it is always best to create a integer primary key, even if a unique key such as social security number, ISBN, or some other business value.  Recently I had to go through the unpleasant process of updating a database table and associated scripts, resources, and code that had used a business attribute as the primary key but because of business requirements it was no longer unique and had grown to have different meanings.  Because your business requirements will change, don&#8217;t use business attributes as primary keys for you database design.  In addition, don&#8217;t overload attributes to more than one meaning.  For example, the database that I was working with had a database column called Sequence that functioned as the primary key, the line number, and a workflow execution order to process the data.  It is a source of confusion and bugs to overload one attribute to so many different meanings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve always found that when defining a database table it is always best to create a integer primary key, even if a unique key such as social security number, ISBN, or some other business value. Recently I had to go through the unpleasant process of updating a database table and associated scripts, resources, and code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[19,23,3],"tags":[98,414,560,573,317,574,561],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-nf","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/1441"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=1441"}],"version-history":[{"count":1,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/1441\/revisions"}],"predecessor-version":[{"id":1442,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/1441\/revisions\/1442"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=1441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=1441"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=1441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}