text: # Generated by Django 2.2.8 on 2019-12-18 13:31
  
  import uuid
  from django.db import migrations, models
  
  
  def generate_uuids(apps, _):
      """
      Generate unique uuids for ReferenceDatasets
      """
      ReferenceDataset = apps.get_model("datasets", "ReferenceDataset")
      for dataset in ReferenceDataset.objects.all():
          dataset.uuid = uuid.uuid4()
          dataset.save()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [("datasets", "0028_add_dataset_source_tags")]
  
      operations = [
          # Add (nullable) ReferenceDataset.uuid
          migrations.AddField(
              model_name="referencedataset",
              name="uuid",
              field=models.UUIDField(blank=True, default=uuid.uuid4, editable=False, null=True),
          ),
          # Create unique uuids for ReferenceDatasets
          migrations.RunPython(generate_uuids, migrations.RunPython.noop),
      ]
  