<reponame>normanjaeckel/Dreifaltigkeit2<gh_stars>0
# Generated by Django 2.0.6 on 2018-08-30 20:05

from django.db import migrations, models
import uuid


def change_uuid(apps, schema_editor):
    """
    Changes UUID for events and announcements.
    """
    # We can't import the model directly as it may be a newer
    # version than this migration expects. We use the historical version.
    Announcement = apps.get_model("dreifaltigkeit", "Announcement")
    Event = apps.get_model("dreifaltigkeit", "Event")
    for item in list(Announcement.objects.all()) + list(Event.objects.all()):
        item.uuid = uuid.uuid4()
        item.save()


class Migration(migrations.Migration):

    dependencies = [("dreifaltigkeit", "0009_flat_page_delete_floetenkreis")]

    operations = [
        migrations.AddField(
            model_name="announcement",
            name="uuid",
            field=models.UUIDField(default=uuid.uuid4, editable=False),
        ),
        migrations.AddField(
            model_name="event",
            name="uuid",
            field=models.UUIDField(default=uuid.uuid4, editable=False),
        ),
        migrations.RunPython(change_uuid),
    ]

# Generated by Django 2.0.6 on 2018-08-30 20:05

from django.db import migrations, models
import uuid


def change_uuid(apps, schema_editor):
    """
    Changes UUID for events and announcements.
    """
    # We can't import the model directly as it may be a newer
    # version than this migration expects. We use the historical version.
    Announcement = apps.get_model("dreifaltigkeit", "Announcement")
    Event = apps.get_model("dreifaltigkeit", "Event")
    for item in list(Announcement.objects.all()) + list(Event.objects.all()):
        item.uuid = uuid.uuid4()
        item.save()


class Migration(migrations.Migration):

    dependencies = [("dreifaltigkeit", "0009_flat_page_delete_floetenkreis")]

    operations = [
        migrations.AddField(
            model_name="announcement",
            name="uuid",
            field=models.UUIDField(default=uuid.uuid4, editable=False),
        ),
        migrations.AddField(
            model_name="event",
            name="uuid",
            field=models.UUIDField(default=uuid.uuid4, editable=False),
        ),
        migrations.RunPython(change_uuid),
    ]
# Generated by Django 2.0.6 on 2018-08-30 20:05 Changes UUID for events and announcements. # We can't import the model directly as it may be a newer # version than this migration expects. We use the historical version.