# Generated by Django 3.2.14 on 2023-04-29 14:48

from django.db import migrations


def set_depth(apps, schema_editor):
    Page = apps.get_model("powerwiki", "Page")
    for page in Page.objects.all():
        page.depth = page.path.count("/")
        page.save()


class Migration(migrations.Migration):
    dependencies = [
        ("powerwiki", "0002_page_depth"),
    ]

    operations = [
        migrations.RunPython(set_depth, migrations.RunPython.noop),
    ]
