﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6663	UUID as Primary Key (Re. 4682)	Jonathan Harker <jon@…>	nobody	"Re [http://code.djangoproject.com/ticket/4682 Ticket 4682]: The OP didn't just want to add a UUID field type, that much should be a reasonably straightforward change. The real idea is to be able to '''''use UUIDs as the primary key''''', instead of an auto-incrementing integer field. There are cases where this is a much better solution (busy write-heavy databases, remote sync using disconnected or asynchronous datasets, and so on).

I'm interested how much fiddling under the hood this would require, but I imagine a PRIMARY_KEY_TYPE option in settings.py. Since one advantage is there is no need to query the database to get the next integer in the PK field, one can simply generate a UUID code-side. I haven't looked under the hood yet, but presumably somewhere there is code to get the next PK integer when creating a new row, which can be so tweaked to generate a UUID instead, before the insert (and including the PK field and its value in the INSERT statement).

Sorry to ramble but I'd be interested to help out with such a venture :-)"	Uncategorized	closed	Database layer (models, ORM)	1.5	Normal	invalid	primary key, uuid	hv@…	Design decision needed	0	0	0	0	0	0
