# Generated by Django 5.0.1 on 2024-01-25 17:49

import django.contrib.auth.models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

import concurrency.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("auth", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Anything",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name="AutoIncConcurrentModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.AutoIncVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
                ("username", models.CharField(blank=True, max_length=30, null=True)),
                ("date_field", models.DateField(blank=True, null=True)),
            ],
            options={
                "verbose_name": "AutoIncConcurrentModel",
                "verbose_name_plural": "AutoIncConcurrentModel",
            },
        ),
        migrations.CreateModel(
            name="ConcreteModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.IntegerVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
                (
                    "username",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
            ],
        ),
        migrations.CreateModel(
            name="SimpleConcurrentModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.IntegerVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
                (
                    "username",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                ("date_field", models.DateField(blank=True, null=True)),
            ],
            options={
                "verbose_name": "SimpleConcurrentModel",
                "verbose_name_plural": "SimpleConcurrentModels",
            },
        ),
        migrations.CreateModel(
            name="ConditionalVersionModelSelfRelation",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.ConditionalVersionField(default=0, help_text="record revision number"),
                ),
                ("name", models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name="DropTriggerConcurrentModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.TriggerVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
                ("username", models.CharField(blank=True, max_length=30, null=True)),
                ("count", models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name="GroupTestModel",
            fields=[
                (
                    "group_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="auth.group",
                    ),
                ),
                ("username", models.CharField(max_length=50, verbose_name="username")),
            ],
            bases=("auth.group",),
            managers=[
                ("objects", django.contrib.auth.models.GroupManager()),
            ],
        ),
        migrations.CreateModel(
            name="Issue3TestModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("username", models.CharField(blank=True, max_length=30, null=True)),
                ("last_name", models.CharField(blank=True, max_length=30, null=True)),
                ("char_field", models.CharField(blank=True, max_length=30, null=True)),
                ("date_field", models.DateField(blank=True, null=True)),
                (
                    "version",
                    models.CharField(blank=True, default="abc", max_length=10, null=True),
                ),
                (
                    "revision",
                    concurrency.fields.IntegerVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ReversionConcurrentModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.IntegerVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
                (
                    "username",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                ("date_field", models.DateField(blank=True, null=True)),
            ],
            options={
                "verbose_name": "Reversion-ConcurrentModel",
                "verbose_name_plural": "Reversion-ConcurrentModels",
            },
        ),
        migrations.CreateModel(
            name="TriggerConcurrentModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.TriggerVersionField(
                        db_column="cm_version_id",
                        default=0,
                        help_text="record revision number",
                    ),
                ),
                ("username", models.CharField(blank=True, max_length=30, null=True)),
                ("count", models.IntegerField(default=0)),
            ],
            options={
                "verbose_name": "TriggerConcurrentModel",
                "verbose_name_plural": "TriggerConcurrentModels",
            },
        ),
        migrations.CreateModel(
            name="ConcurrencyDisabledModel",
            fields=[
                (
                    "simpleconcurrentmodel_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="demo.simpleconcurrentmodel",
                    ),
                ),
                ("dummy_char", models.CharField(blank=True, max_length=30, null=True)),
            ],
            bases=("demo.simpleconcurrentmodel",),
        ),
        migrations.CreateModel(
            name="CustomSaveModel",
            fields=[
                (
                    "simpleconcurrentmodel_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="demo.simpleconcurrentmodel",
                    ),
                ),
                (
                    "extra_field",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
            ],
            bases=("demo.simpleconcurrentmodel",),
        ),
        migrations.CreateModel(
            name="InheritedModel",
            fields=[
                (
                    "simpleconcurrentmodel_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="demo.simpleconcurrentmodel",
                    ),
                ),
                (
                    "extra_field",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
            ],
            bases=("demo.simpleconcurrentmodel",),
        ),
        migrations.CreateModel(
            name="ListEditableConcurrentModel",
            fields=[],
            options={
                "verbose_name": "ListEditableConcurrentModel",
                "verbose_name_plural": "ListEditableConcurrentModels",
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("demo.simpleconcurrentmodel",),
        ),
        migrations.CreateModel(
            name="NoActionsConcurrentModel",
            fields=[],
            options={
                "verbose_name": "NoActions-ConcurrentModel",
                "verbose_name_plural": "NoActions-ConcurrentModels",
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("demo.simpleconcurrentmodel",),
        ),
        migrations.CreateModel(
            name="ProxyModel",
            fields=[],
            options={
                "verbose_name": "ProxyModel",
                "verbose_name_plural": "ProxyModels",
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("demo.simpleconcurrentmodel",),
        ),
        migrations.CreateModel(
            name="ConditionalVersionModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.ConditionalVersionField(default=0, help_text="record revision number"),
                ),
                (
                    "field1",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                (
                    "field2",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                (
                    "field3",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                (
                    "user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ConditionalVersionModelWithoutMeta",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.ConditionalVersionField(default=0, help_text="record revision number"),
                ),
                (
                    "field1",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                (
                    "field2",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                (
                    "field3",
                    models.CharField(blank=True, max_length=30, null=True, unique=True),
                ),
                ("anythings", models.ManyToManyField(to="demo.anything")),
                (
                    "user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="anything",
            name="a_relation",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="demo.conditionalversionmodelwithoutmeta",
            ),
        ),
        migrations.CreateModel(
            name="ThroughRelation",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "version",
                    concurrency.fields.ConditionalVersionField(default=0, help_text="record revision number"),
                ),
                (
                    "left",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="demo.conditionalversionmodelselfrelation",
                    ),
                ),
                (
                    "right",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="demo.conditionalversionmodelselfrelation",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="conditionalversionmodelselfrelation",
            name="relations",
            field=models.ManyToManyField(
                blank=True,
                through="demo.ThroughRelation",
                to="demo.conditionalversionmodelselfrelation",
            ),
        ),
    ]
