Sporkmonger

purveyor of fabulously ambiguous eating utensils

UUID As A Primary Key

Posted by sporkmonger
Written October 28th, 2005

Paul Dix wrote up a quick how-to on using UUIDTools and ActiveRecord for generating UUIDs for use as a primary key on your tables. Based on a couple of comments over on Robi Sen’s blog. Thanks for doing this Paul—judging by the keywords people that find their way to this blog are using for their google searches, there’s a surprising number of people trying to do this.

  1. Robi Sen Robi Sen :
    Written October 28th, 2005 at 08:48 PM

    Thats a great How-To. Ill have to blog this and start using this method. Thanks again for your comments and help to a Rails newbie.

  2. Written October 31st, 2005 at 06:03 PM

    It’s the exact same code I posted on your blog earlier, by the way (just without the HTML formatting getting eaten). But you’re quite welcome!

Leave a Response

NOTE: I'm afraid Javascript needs to be on in order to comment.

Comments should be formatted using Textile.

Ruby code should be enclosed within a <macro:code lang="ruby"> element. Other languages are supported. For output you can simply omit the lang attribute.