diff --git a/sfm/ui/migrations/0007_auto_20161104_1454.py b/sfm/ui/migrations/0006_auto_20161114_1637.py similarity index 76% rename from sfm/ui/migrations/0007_auto_20161104_1454.py rename to sfm/ui/migrations/0006_auto_20161114_1637.py index f005a99c..f3a5cce7 100644 --- a/sfm/ui/migrations/0007_auto_20161104_1454.py +++ b/sfm/ui/migrations/0006_auto_20161114_1637.py @@ -4,19 +4,25 @@ from django.db import migrations, models import datetime from django.utils.timezone import utc +import ui.models class Migration(migrations.Migration): dependencies = [ - ('ui', '0006_auto_20161101_1121'), + ('ui', '0005_user_harvest_notifications'), ] operations = [ + migrations.AddField( + model_name='credential', + name='credential_id', + field=models.CharField(default=ui.models.default_uuid, null=True, max_length=32), + ), migrations.AddField( model_name='export', name='date_updated', - field=models.DateTimeField(default=datetime.datetime(2016, 11, 4, 18, 54, 9, 637584, tzinfo=utc), auto_now=True), + field=models.DateTimeField(default=datetime.datetime(2016, 11, 14, 21, 37, 16, 973833, tzinfo=utc), auto_now=True), preserve_default=False, ), migrations.AddField( @@ -49,6 +55,11 @@ class Migration(migrations.Migration): name='service', field=models.CharField(max_length=255, null=True), ), + migrations.AddField( + model_name='historicalcredential', + name='credential_id', + field=models.CharField(default=ui.models.default_uuid, max_length=32, db_index=True), + ), migrations.AlterField( model_name='export', name='status', diff --git a/sfm/ui/migrations/0007_auto_20161114_1637.py b/sfm/ui/migrations/0007_auto_20161114_1637.py new file mode 100644 index 00000000..04226c8a --- /dev/null +++ b/sfm/ui/migrations/0007_auto_20161114_1637.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + +import uuid + + +def gen_uuid(apps, schema_editor): + MyModel = apps.get_model('ui', 'Credential') + for row in MyModel.objects.all(): + row.credential_id = uuid.uuid4() + row.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('ui', '0006_auto_20161114_1637'), + ] + + operations = [ + # omit reverse_code=... if you don't want the migration to be reversible. + migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop), + ] diff --git a/sfm/ui/migrations/0006_auto_20161101_1121.py b/sfm/ui/migrations/0008_auto_20161114_1638.py similarity index 56% rename from sfm/ui/migrations/0006_auto_20161101_1121.py rename to sfm/ui/migrations/0008_auto_20161114_1638.py index 77b40014..55a16fd4 100644 --- a/sfm/ui/migrations/0006_auto_20161101_1121.py +++ b/sfm/ui/migrations/0008_auto_20161114_1638.py @@ -4,22 +4,16 @@ from django.db import migrations, models import ui.models - class Migration(migrations.Migration): dependencies = [ - ('ui', '0005_user_harvest_notifications'), + ('ui', '0007_auto_20161114_1637'), ] operations = [ - migrations.AddField( + migrations.AlterField( model_name='credential', name='credential_id', field=models.CharField(default=ui.models.default_uuid, unique=True, max_length=32), ), - migrations.AddField( - model_name='historicalcredential', - name='credential_id', - field=models.CharField(default=ui.models.default_uuid, max_length=32, db_index=True), - ), ]