<reponame>livelihoods-and-landscapes/qfieldcloud-tcs<filename>docker-app/qfieldcloud/core/migrations/0028_auto_20210414_1545.py<gh_stars>10-100
# Generated by Django 3.2 on 2021-04-14 15:45

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0027_auto_20210408_0138"),
    ]

    def set_is_public(apps, schema_editor):
        Project = apps.get_model("core", "Project")

        for project in Project.objects.all():
            project.is_public = not project.private
            project.save()

    operations = [
        migrations.AddField(
            model_name="project",
            name="is_public",
            field=models.BooleanField(
                default=False,
                help_text="Projects that are marked as public would be visible and editable to anyone.",
            ),
        ),
        migrations.RunPython(set_is_public, reverse_code=migrations.RunPython.noop),
        migrations.RemoveField(
            model_name="project",
            name="private",
        ),
    ]

# Generated by Django 3.2 on 2021-04-14 15:45

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0027_auto_20210408_0138"),
    ]

    def set_is_public(apps, schema_editor):
        Project = apps.get_model("core", "Project")

        for project in Project.objects.all():
            project.is_public = not project.private
            project.save()

    operations = [
        migrations.AddField(
            model_name="project",
            name="is_public",
            field=models.BooleanField(
                default=False,
                help_text="Projects that are marked as public would be visible and editable to anyone.",
            ),
        ),
        migrations.RunPython(set_is_public, reverse_code=migrations.RunPython.noop),
        migrations.RemoveField(
            model_name="project",
            name="private",
        ),
    ]
# Generated by Django 3.2 on 2021-04-14 15:45