mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
729 B
27 lines
729 B
# Generated by Django 4.0.2 on 2022-05-12 02:28
|
|
|
|
from django.db import migrations
|
|
|
|
import uuid
|
|
|
|
|
|
def gen_uuid(apps, schema_editor):
|
|
Category = apps.get_model("labels", "Category")
|
|
Span = apps.get_model("labels", "Span")
|
|
Relation = apps.get_model("labels", "Relation")
|
|
TextLabel = apps.get_model("labels", "TextLabel")
|
|
for label in [Category, Span, Relation, TextLabel]:
|
|
for row in label.objects.all():
|
|
row.uuid = uuid.uuid4()
|
|
row.save(update_fields=["uuid"])
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("labels", "0012_add_uuid_field"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop),
|
|
]
|