# -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2019-08-19 11:06
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Hierarchy',
            fields=[
                ('id', models.AutoField(
                    auto_created=True, primary_key=True,
                    serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256)),
                ('base_url', models.CharField(default=b'', max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='PageBlock',
            fields=[
                ('id', models.AutoField(
                    auto_created=True, primary_key=True,
                    serialize=False, verbose_name='ID')),
                ('ordinality', models.PositiveIntegerField(default=1)),
                ('label', models.CharField(blank=True,
                                           max_length=256, null=True)),
                ('object_id', models.PositiveIntegerField()),
                ('content_type', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE,
                    to='contenttypes.ContentType')),
            ],
            options={
                'ordering': ('section', 'ordinality'),
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(
                    auto_created=True, primary_key=True,
                    serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=256)),
                ('slug', models.SlugField()),
                ('is_root', models.BooleanField(default=False)),
                ('hierarchy', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE,
                    to='pagetree.Hierarchy')),
            ],
        ),
        migrations.CreateModel(
            name='SectionChildren',
            fields=[
                ('id', models.AutoField(
                    auto_created=True, primary_key=True,
                    serialize=False, verbose_name='ID')),
                ('ordinality', models.PositiveIntegerField(default=1)),
                ('child', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='child', to='pagetree.Section')),
                ('parent', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='parent', to='pagetree.Section')),
            ],
            options={
                'ordering': ('ordinality',),
            },
        ),
        migrations.AddField(
            model_name='pageblock',
            name='section',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='pagetree.Section'),
        ),
    ]
