~linuxgoose/bocpress

ref: 41c863a31c1d409617a61ace48c4c2dff4ad6d14 bocpress/main/migrations/0095_auto_20231109_2111.py -rw-r--r-- 504 bytes
41c863a3Jordan Robinson update footer to include link to docs site 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Generated by Django 4.2.7 on 2023-11-09 21:11

import uuid

from django.db import migrations


def gen_uuid(apps, schema_editor):
    Onboard = apps.get_model("main", "Onboard")
    for row in Onboard.objects.all():
        row.code = uuid.uuid4()
        row.save(update_fields=["code"])


class Migration(migrations.Migration):
    dependencies = [
        ("main", "0094_onboard_code"),
    ]

    operations = [
        migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop),
    ]