# Generated by Django 3.1.10 on 2021-07-16 11:12

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


class Migration(migrations.Migration):

    dependencies = [
        ("programmes", "0062_add_subject_slugs"),
        ("people", "0028_studentpage_student_user_image_collection"),
        ("editorial", "0004_editoriallistingpage_editoriallistingrelatededitorialpage"),
    ]

    operations = [
        migrations.CreateModel(
            name="EditorialPageDirectorate",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "directorate",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="related_editorial_pages",
                        to="people.directorate",
                        verbose_name="Directorates",
                    ),
                ),
                (
                    "page",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="related_directorates",
                        to="editorial.editorialpage",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="EditorialPageSubjectPlacement",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "page",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="subjects",
                        to="editorial.editorialpage",
                    ),
                ),
                (
                    "subject",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="editorial_pages",
                        to="programmes.subject",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="EditorialPageTypePlacement",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "page",
                    modelcluster.fields.ParentalKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="editorial_types",
                        to="editorial.editorialpage",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="EditorialType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=128)),
                ("slug", models.SlugField(blank=True)),
            ],
        ),
        migrations.RemoveField(
            model_name="editorialpagerelatedschoolsandresearchpages",
            name="page",
        ),
        migrations.RemoveField(
            model_name="editorialpagerelatedschoolsandresearchpages",
            name="source_page",
        ),
        migrations.DeleteModel(
            name="EditorialPageArea",
        ),
        migrations.DeleteModel(
            name="EditorialPageRelatedSchoolsAndResearchPages",
        ),
        migrations.AddField(
            model_name="editorialpagetypeplacement",
            name="type",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="editorial_pages",
                to="editorial.editorialtype",
            ),
        ),
    ]
