{"id":5102,"date":"2019-01-03T14:05:57","date_gmt":"2019-01-03T13:05:57","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=5102"},"modified":"2019-01-03T14:06:06","modified_gmt":"2019-01-03T13:06:06","slug":"auto-generated-primary-keys-friends-or-foes-3","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2019\/01\/03\/auto-generated-primary-keys-friends-or-foes-3\/","title":{"rendered":"Auto-generated Primary Keys, friends or foes?"},"content":{"rendered":"<p>Time to read againg <em><a href=\"https:\/\/www.soft-land.org\/documenti\/pk\">Auto-generated Primary Keys, friends or foes?<\/a> of the almighty Davide.<\/em><\/p>\n<p>I will save it somewhere, hoping that it will never go offline. In that case you will find it <a href=\"https:\/\/monodes.com\/predaelli\/2019\/01\/03\/auto-generated-primary-keys-friends-or-foes-2\/\">here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Time to read againg Auto-generated Primary Keys, friends or foes? of the almighty Davide. I will save it somewhere, hoping that it will never go offline. In that case you will find it here. &nbsp;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2019\/01\/03\/auto-generated-primary-keys-friends-or-foes-3\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72],"tags":[],"class_list":["post-5102","post","type-post","status-publish","format-standard","hentry","category-documentations"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1ki","jetpack-related-posts":[{"id":7357,"url":"https:\/\/monodes.com\/predaelli\/2020\/06\/24\/dont-use-database-generated-ids-the-startup\/","url_meta":{"origin":5102,"position":0},"title":"Don&#8217;t Use Database Generated IDs | The Startup","author":"Paolo Redaelli","date":"2020-06-24","format":false,"excerpt":"Stop letting the database be in charge of your application Source: Don't Use Database Generated IDs | The Startup This is old lore: the almight Davide Bianchi wrote in 2002 \"PK autogenerate... amici o nemici?\" (\"autogenerated Primary Keys... friends or foes?. The answer is plain, simple, short Absolutely no! Then\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5155,"url":"https:\/\/monodes.com\/predaelli\/2019\/01\/25\/multiple-fields-primary-keys-in-django\/","url_meta":{"origin":5102,"position":1},"title":"Multiple fields primary keys in Django","author":"Paolo Redaelli","date":"2019-01-25","format":false,"excerpt":"I'm developing a little application in Django. Having developed a subtle dislike for UUIDs used as primary keys I tend to rely of the \"natural keys\" which are almost always identificable in a data model. Often thought those keys span over several fields. Think about a receipt of a multi-store\u2026","rel":"","context":"In &quot;Django&quot;","block_context":{"text":"Django","link":"https:\/\/monodes.com\/predaelli\/category\/python\/django\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9598,"url":"https:\/\/monodes.com\/predaelli\/2022\/09\/14\/choosing-a-postgres-primary-key\/","url_meta":{"origin":5102,"position":2},"title":"Choosing a Postgres Primary Key","author":"Paolo Redaelli","date":"2022-09-14","format":"link","excerpt":"\u00a0Choosing a Postgres Primary Key Choosing a Postgres Primary Key 2022-09-08 \u2022 24 minute read VictorGuest Author Primary keys are important. They uniquely identify rows of data in tables, and make it easy to fetch data. The job of a database is to archive and recall data and you're going\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1872,"url":"https:\/\/monodes.com\/predaelli\/2016\/11\/02\/cert-for-both-www-and-plain-domain\/","url_meta":{"origin":5102,"position":3},"title":"Cert for both www and plain domain","author":"Paolo Redaelli","date":"2016-11-02","format":false,"excerpt":"Just a note for myself: renew Let's Encrypt certificate to make it valid for both www and plain domain You should be able to do that using the command you originally used to obtain the certificate. Add --force-renewal to force the client to get a new certificate even if the\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5529,"url":"https:\/\/monodes.com\/predaelli\/2019\/04\/30\/58-bytes-of-css-to-look-great-nearly-everywhere\/","url_meta":{"origin":5102,"position":4},"title":"58 bytes of css to look great nearly everywhere","author":"Paolo Redaelli","date":"2019-04-30","format":"link","excerpt":"58 bytes of css to look great nearly everywhere when making this website, i wanted a simple, reasonable way to make it look good on most displays. not counting any minimization techniques, the following 58 bytes worked well for me: main { max-width: 38rem; padding: 2rem; margin: auto; } let's\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10569,"url":"https:\/\/monodes.com\/predaelli\/2023\/06\/26\/incidenti-auto-risarcimento-anche-se-le-riparazioni-superano-il-valore-residuo\/","url_meta":{"origin":5102,"position":5},"title":"Incidenti auto, risarcimento anche se le riparazioni superano il valore residuo","author":"Paolo Redaelli","date":"2023-06-26","format":false,"excerpt":"Ogni tanto qualche timida, buona notizia.... Secondo la Corte di Cassazione gli automobilisti hanno diritto a un risarcimento completo per gli incidenti stradali, indipendentemente dal valore commerciale del veicolo La Corte di Cassazione ha recentemente emesso una sentenza che estende ulteriormente i diritti degli automobilisti coinvolti in incidenti stradali. In\u2026","rel":"","context":"In &quot;Good news&quot;","block_context":{"text":"Good news","link":"https:\/\/monodes.com\/predaelli\/category\/good-news\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/06\/6496b5867e3c2.jpeg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/06\/6496b5867e3c2.jpeg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/06\/6496b5867e3c2.jpeg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/06\/6496b5867e3c2.jpeg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2023\/06\/6496b5867e3c2.jpeg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=5102"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/5102\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=5102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=5102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=5102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}