# Generated by Django 2.1.12 on 2019-09-06 10:02

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

import richie.apps.core.models


class Migration(migrations.Migration):

    dependencies = [
        ("cms", "0022_auto_20180620_1551"),
        ("courses", "0005_auto_20190717_0827"),
    ]

    operations = [
        migrations.CreateModel(
            name="Program",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "extended_object",
                    models.OneToOneField(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="cms.Page",
                    ),
                ),
                (
                    "public_extension",
                    models.OneToOneField(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="draft_extension",
                        to="courses.Program",
                    ),
                ),
            ],
            options={
                "verbose_name": "program",
                "db_table": "richie_program",
                "ordering": ["-pk"],
            },
        ),
        migrations.CreateModel(
            name="ProgramPluginModel",
            fields=[
                (
                    "cmsplugin_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        related_name="courses_programpluginmodel",
                        serialize=False,
                        to="cms.CMSPlugin",
                    ),
                ),
                (
                    "page",
                    models.ForeignKey(
                        limit_choices_to={
                            "program__isnull": False,
                            "publisher_is_draft": True,
                        },
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="program_plugins",
                        to="cms.Page",
                    ),
                ),
            ],
            options={
                "verbose_name": "program plugin",
                "db_table": "richie_program_plugin",
            },
            bases=(richie.apps.core.models.PagePluginMixin, "cms.cmsplugin"),
        ),
    ]
