# Generated by Django 3.1.2 on 2021-02-24 20:44

import os
import uuid

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

import treebeard.ltree.fields


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="AL_TestNode",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("sib_order", models.PositiveIntegerField()),
                ("desc", models.CharField(max_length=255)),
                (
                    "parent",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="children_set",
                        to="tests.al_testnode",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNode",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeAlphabet",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("numval", models.IntegerField()),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeCustomId",
            fields=[
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeShortPath",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=4, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeSmallStep",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeSorted",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("val1", models.IntegerField()),
                ("val2", models.IntegerField()),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeInheritedSorted",
            fields=[
                (
                    "mp_testnodesorted_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="tests.mp_testnodesorted",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("tests.mp_testnodesorted",),
        ),
        migrations.CreateModel(
            name="MP_TestNodeSortedAutoNow",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("desc", models.CharField(max_length=255)),
                ("created", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeUuid",
            fields=[
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("custom_id", models.UUIDField(default=uuid.uuid1, editable=False, primary_key=True, serialize=False)),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestSortedNodeShortPath",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=4, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="NS_TestNode",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("lft", models.PositiveIntegerField(db_index=True)),
                ("rgt", models.PositiveIntegerField(db_index=True)),
                ("tree_id", models.PositiveIntegerField(db_index=True)),
                ("depth", models.PositiveIntegerField(db_index=True)),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="NS_TestNodeSorted",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("lft", models.PositiveIntegerField(db_index=True)),
                ("rgt", models.PositiveIntegerField(db_index=True)),
                ("tree_id", models.PositiveIntegerField(db_index=True)),
                ("depth", models.PositiveIntegerField(db_index=True)),
                ("val1", models.IntegerField()),
                ("val2", models.IntegerField()),
                ("desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="RelatedModel",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("desc", models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name="AL_TestNodeInherited",
            fields=[
                (
                    "al_testnode_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="tests.al_testnode",
                    ),
                ),
                ("extra_desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
            bases=("tests.al_testnode",),
        ),
        migrations.CreateModel(
            name="MP_TestNodeInherited",
            fields=[
                (
                    "mp_testnode_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="tests.mp_testnode",
                    ),
                ),
                ("extra_desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
            bases=("tests.mp_testnode",),
        ),
        migrations.CreateModel(
            name="NS_TestNodeInherited",
            fields=[
                (
                    "ns_testnode_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="tests.ns_testnode",
                    ),
                ),
                ("extra_desc", models.CharField(max_length=255)),
            ],
            options={
                "abstract": False,
            },
            bases=("tests.ns_testnode",),
        ),
        migrations.CreateModel(
            name="NS_TestNodeSomeDep",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("node", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.ns_testnode")),
            ],
        ),
        migrations.CreateModel(
            name="NS_TestNodeRelated",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("lft", models.PositiveIntegerField(db_index=True)),
                ("rgt", models.PositiveIntegerField(db_index=True)),
                ("tree_id", models.PositiveIntegerField(db_index=True)),
                ("depth", models.PositiveIntegerField(db_index=True)),
                ("desc", models.CharField(max_length=255)),
                ("related", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.relatedmodel")),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="MP_TestNodeSomeDep",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("node", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.mp_testnode")),
            ],
        ),
        migrations.CreateModel(
            name="MP_TestNodeRelated",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("path", models.CharField(max_length=255, unique=True)),
                ("depth", models.PositiveIntegerField()),
                ("numchild", models.PositiveIntegerField(default=0)),
                ("desc", models.CharField(max_length=255)),
                ("related", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.relatedmodel")),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="AL_TestNodeSorted",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("val1", models.IntegerField()),
                ("val2", models.IntegerField()),
                ("desc", models.CharField(max_length=255)),
                (
                    "parent",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="children_set",
                        to="tests.al_testnodesorted",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="AL_TestNodeSomeDep",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("node", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.al_testnode")),
            ],
        ),
        migrations.CreateModel(
            name="AL_TestNodeRelated",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("sib_order", models.PositiveIntegerField()),
                ("desc", models.CharField(max_length=255)),
                (
                    "parent",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="children_set",
                        to="tests.al_testnoderelated",
                    ),
                ),
                ("related", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.relatedmodel")),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="AL_TestNode_Proxy",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("tests.al_testnode",),
        ),
        migrations.CreateModel(
            name="MP_TestNode_Proxy",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("tests.mp_testnode",),
        ),
        migrations.CreateModel(
            name="NS_TestNode_Proxy",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("tests.ns_testnode",),
        ),
    ]


if os.environ.get("DATABASE_ENGINE") == "psql":
    Migration.operations.extend(
        [
            migrations.CreateModel(
                name="LT_TestNode",
                fields=[
                    (
                        "id",
                        models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"),
                    ),
                    ("path", treebeard.ltree.fields.PathField(unique=True)),
                    ("desc", models.CharField(max_length=255)),
                ],
                options={
                    "abstract": False,
                },
            ),
            migrations.CreateModel(
                name="LT_TestNodeInherited",
                fields=[
                    (
                        "lt_testnode_ptr",
                        models.OneToOneField(
                            auto_created=True,
                            on_delete=django.db.models.deletion.CASCADE,
                            parent_link=True,
                            primary_key=True,
                            serialize=False,
                            to="tests.lt_testnode",
                        ),
                    ),
                    ("extra_desc", models.CharField(max_length=255)),
                ],
                options={
                    "abstract": False,
                },
                bases=("tests.lt_testnode",),
            ),
            migrations.CreateModel(
                name="LT_TestNodeSomeDep",
                fields=[
                    (
                        "id",
                        models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"),
                    ),
                    ("node", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="tests.lt_testnode")),
                ],
            ),
            migrations.CreateModel(
                name="LT_TestNode_Proxy",
                fields=[],
                options={
                    "proxy": True,
                    "indexes": [],
                    "constraints": [],
                },
                bases=("tests.lt_testnode",),
            ),
            migrations.CreateModel(
                name="LT_TestNodeSorted",
                fields=[
                    (
                        "id",
                        models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"),
                    ),
                    ("path", treebeard.ltree.fields.PathField(unique=True)),
                    ("val1", models.IntegerField()),
                    ("val2", models.IntegerField()),
                    ("desc", models.CharField(max_length=255)),
                ],
                options={
                    "abstract": False,
                },
            ),
            migrations.CreateModel(
                name="LT_TestNodeInheritedSorted",
                fields=[
                    (
                        "lt_testnodesorted_ptr",
                        models.OneToOneField(
                            auto_created=True,
                            on_delete=django.db.models.deletion.CASCADE,
                            parent_link=True,
                            primary_key=True,
                            serialize=False,
                            to="tests.lt_testnodesorted",
                        ),
                    ),
                ],
                options={
                    "abstract": False,
                },
                bases=("tests.lt_testnodesorted",),
            ),
        ]
    )
