This commit is contained in:
Thomas Steen Rasmussen 2020-02-22 16:21:51 +01:00
parent b235cb9683
commit eb18fc2ec5
3 changed files with 49 additions and 1 deletions

View file

@ -19,7 +19,7 @@ class Migration(migrations.Migration):
default=uuid.uuid4,
editable=False,
help_text="This field is mostly here to keep Frab happy, it is not the PK of the model",
unique=True,
null=True,
),
),
]

View file

@ -0,0 +1,23 @@
# Generated by Django 3.0.3 on 2020-02-22 15:13
import uuid
from django.db import migrations
def gen_uuid(apps, schema_editor):
MyModel = apps.get_model("program", "EventInstance")
for row in MyModel.objects.all():
row.uuid = uuid.uuid4()
row.save(update_fields=["uuid"])
class Migration(migrations.Migration):
dependencies = [
("program", "0080_auto_20200222_1547"),
]
operations = [
migrations.RunPython(gen_uuid),
]

View file

@ -0,0 +1,25 @@
# Generated by Django 3.0.3 on 2020-02-22 15:13
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("program", "0081_populate_eventinstance_uuids"),
]
operations = [
migrations.AlterField(
model_name="eventinstance",
name="uuid",
field=models.UUIDField(
default=uuid.uuid4,
editable=False,
help_text="This field is mostly here to keep Frab happy, it is not the PK of the model",
unique=True,
),
),
]