# Generated by Django 2.2.13 on 2021-09-01 12:27

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import enumfields.fields
import leasing.enums


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("leasing", "0045_move_plotsearch_to_plotsearch_app"),
    ]

    operations = [
        migrations.CreateModel(
            name="PlotSearch",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("deleted", models.DateTimeField(editable=False, null=True)),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="Time created"
                    ),
                ),
                (
                    "modified_at",
                    models.DateTimeField(auto_now=True, verbose_name="Time modified"),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
                (
                    "begin_at",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="Begin at"
                    ),
                ),
                (
                    "end_at",
                    models.DateTimeField(blank=True, null=True, verbose_name="End at"),
                ),
                (
                    "preparer",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Preparer",
                    ),
                ),
            ],
            options={
                "verbose_name": "Plot search",
                "verbose_name_plural": "Plot searches",
            },
        ),
        migrations.CreateModel(
            name="PlotSearchStage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
            ],
            options={
                "verbose_name": "Plot search stage",
                "verbose_name_plural": "Plot search stages",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PlotSearchType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
            ],
            options={
                "verbose_name": "Plot search type",
                "verbose_name_plural": "Plot search types",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PlotSearchTarget",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "target_type",
                    enumfields.fields.EnumField(
                        enum=leasing.enums.PlotSearchTargetType,
                        max_length=30,
                        verbose_name="Target type",
                    ),
                ),
                (
                    "plan_unit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="leasing.PlanUnit",
                    ),
                ),
                (
                    "plot_search",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="plotsearch.PlotSearch",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="PlotSearchSubtype",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
                (
                    "plot_search_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="plotsearch.PlotSearchType",
                    ),
                ),
            ],
            options={
                "verbose_name": "Plot search subtype",
                "verbose_name_plural": "Plot search subtypes",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="plotsearch",
            name="stage",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="plotsearch.PlotSearchStage",
                verbose_name="Stage",
            ),
        ),
        migrations.AddField(
            model_name="plotsearch",
            name="subtype",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="plotsearch.PlotSearchSubtype",
                verbose_name="Subtype",
            ),
        ),
        migrations.AddField(
            model_name="plotsearch",
            name="targets",
            field=models.ManyToManyField(
                through="plotsearch.PlotSearchTarget", to="leasing.PlanUnit"
            ),
        ),
    ]

# Generated by Django 2.2.13 on 2021-09-01 12:27

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import enumfields.fields
import leasing.enums


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("leasing", "0045_move_plotsearch_to_plotsearch_app"),
    ]

    operations = [
        migrations.CreateModel(
            name="PlotSearch",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("deleted", models.DateTimeField(editable=False, null=True)),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="Time created"
                    ),
                ),
                (
                    "modified_at",
                    models.DateTimeField(auto_now=True, verbose_name="Time modified"),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
                (
                    "begin_at",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="Begin at"
                    ),
                ),
                (
                    "end_at",
                    models.DateTimeField(blank=True, null=True, verbose_name="End at"),
                ),
                (
                    "preparer",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Preparer",
                    ),
                ),
            ],
            options={
                "verbose_name": "Plot search",
                "verbose_name_plural": "Plot searches",
            },
        ),
        migrations.CreateModel(
            name="PlotSearchStage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
            ],
            options={
                "verbose_name": "Plot search stage",
                "verbose_name_plural": "Plot search stages",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PlotSearchType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
            ],
            options={
                "verbose_name": "Plot search type",
                "verbose_name_plural": "Plot search types",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PlotSearchTarget",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "target_type",
                    enumfields.fields.EnumField(
                        enum=leasing.enums.PlotSearchTargetType,
                        max_length=30,
                        verbose_name="Target type",
                    ),
                ),
                (
                    "plan_unit",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="leasing.PlanUnit",
                    ),
                ),
                (
                    "plot_search",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="plotsearch.PlotSearch",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="PlotSearchSubtype",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255, verbose_name="Name")),
                (
                    "plot_search_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="plotsearch.PlotSearchType",
                    ),
                ),
            ],
            options={
                "verbose_name": "Plot search subtype",
                "verbose_name_plural": "Plot search subtypes",
                "ordering": ["name"],
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="plotsearch",
            name="stage",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="plotsearch.PlotSearchStage",
                verbose_name="Stage",
            ),
        ),
        migrations.AddField(
            model_name="plotsearch",
            name="subtype",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="plotsearch.PlotSearchSubtype",
                verbose_name="Subtype",
            ),
        ),
        migrations.AddField(
            model_name="plotsearch",
            name="targets",
            field=models.ManyToManyField(
                through="plotsearch.PlotSearchTarget", to="leasing.PlanUnit"
            ),
        ),
    ]

# Generated by Django 2.2.13 on 2021-09-01 12:27