﻿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
25007	UUIDFIeld(default=uuid.uuid4) created with migrations are the same	afg984	nobody	"Steps to reproduce:

1. Create model
{{{#!python
class Bar(models.Model):
    pass
}}}

2. makemigrations & migrate

3. Create some Bar()s in the database
{{{#!python
>>> Bar.objects.create()
<Bar: Bar object>
>>> Bar.objects.create()
<Bar: Bar object>
>>> Bar.objects.create()
<Bar: Bar object>
>>> Bar.objects.create()
<Bar: Bar object>
}}}

4. Add a UUIDField
{{{#!python
class Bar(models.Model):
    uu = models.UUIDField(default=uuid.uuid4)
}}}

5. makemigrations & migrate

if I use `unique=True` in the previous step, `./manage.py migrate` gives me:
{{{django.db.utils.IntegrityError: UNIQUE constraint failed: foo_bar__new.uu}}}

6. The UUIDs are the same
{{{#!python
>>> [bar.uu for bar in Bar.objects.all()]
[UUID('fae77227-7555-457d-a049-1e62e030ce1c'), UUID('fae77227-7555-457d-a049-1e62e030ce1c'), UUID('fae77227-7555-457d-a049-1e62e030ce1c'), UUID('fae77227-7555-457d-a049-1e62e030ce1c')]
}}}


Environment:
{{{#!python
>>> platform.python_version()
'3.4.3'
>>> platform.platform()
'Linux-4.0.5-1-ARCH-x86_64-with-arch'
>>> django.__version__
'1.8.2'
}}}"	Bug	closed	Migrations	1.8	Normal	invalid	migrations, uuid, UUIDField	afg984@…	Unreviewed	0	0	0	0	0	0
