by labria on 4/27/13, 2:43 PM with 37 comments
by JasonPunyon on 4/27/13, 9:40 PM
If you use random UUID's (as opposed to sequential UUID's) for your primary key your database will spend an extra hunk of time on reordering your PK index on disk on insert. This bit us at Stackoverflow. So remember: just because you can do something doesn't mean you should.
by tenderlove on 4/27/13, 8:25 PM
create_table(:users, id: :uuid) do |t|
t.string 'name'
end
And to make sure the extension is enabled, (in your migrations) do: enable_extension 'uuid-ossp'
For now, make sure to use SQL schema dumping. I don't think Ruby schema files will work (as I haven't written a test for it yet).EDIT: I forgot to mention, you can enable hstore by using "enable_extension('hstore')"
by floormat on 4/27/13, 4:58 PM
What is the value of this? Why can't unique identification be done using just regular increments on an ID column? Or even a composite key?
by zimbatm on 4/27/13, 3:18 PM
t.primary_key :id, :type => :uuid
by jashmenn on 4/28/13, 12:15 AM
by labria on 4/27/13, 10:52 PM
by joseph4521 on 4/27/13, 9:30 PM
by flog on 4/27/13, 5:11 PM
by scotth on 4/27/13, 4:38 PM