# Generated by Django 5.1.1 on 2025-01-02 22:55

import bloomerp.models.fields
import bloomerp_tests.models
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("bloomerp_tests", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="child",
            options={
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "bulk_change",
                    "bulk_delete",
                    "bulk_add",
                    "export",
                )
            },
        ),
        migrations.AlterModelOptions(
            name="parent",
            options={
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "bulk_change",
                    "bulk_delete",
                    "bulk_add",
                    "export",
                )
            },
        ),
        migrations.RemoveField(
            model_name="child",
            name="parent",
        ),
        migrations.AddField(
            model_name="child",
            name="avatar",
            field=models.ImageField(blank=True, null=True, upload_to="avatars/"),
        ),
        migrations.AddField(
            model_name="child",
            name="created_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="%(class)s_created",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="child",
            name="datetime_created",
            field=models.DateTimeField(
                auto_now_add=True, default=django.utils.timezone.now
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="child",
            name="datetime_updated",
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name="child",
            name="parent_with_related_name",
            field=models.ForeignKey(
                default=1,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="children",
                to="bloomerp_tests.parent",
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="child",
            name="parent_without_related_name",
            field=models.ForeignKey(
                default=1,
                on_delete=django.db.models.deletion.CASCADE,
                to="bloomerp_tests.parent",
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="child",
            name="status",
            field=bloomerp.models.fields.StatusField(
                choices=[
                    ("active", "Active"),
                    ("inactive", "Inactive"),
                    ("pending", "Pending"),
                ],
                colored_choices=[
                    ("active", "Active", "#00ff00"),
                    ("inactive", "Inactive", "#ff0000"),
                    ("pending", "Pending", "#ffff00"),
                ],
                default="active",
                max_length=255,
            ),
        ),
        migrations.AddField(
            model_name="child",
            name="updated_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="%(class)s_updated",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="parent",
            name="avatar",
            field=models.ImageField(blank=True, null=True, upload_to="avatars/"),
        ),
        migrations.AddField(
            model_name="parent",
            name="created_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="%(class)s_created",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="parent",
            name="date",
            field=models.DateField(default=bloomerp_tests.models.generate_random_date),
        ),
        migrations.AddField(
            model_name="parent",
            name="datetime_created",
            field=models.DateTimeField(auto_now_add=True, default=1),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="parent",
            name="datetime_updated",
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name="parent",
            name="status",
            field=bloomerp.models.fields.StatusField(
                choices=[
                    ("active", "Active"),
                    ("inactive", "Inactive"),
                    ("pending", "Pending"),
                ],
                colored_choices=[
                    ("active", "Active", "#00ff00"),
                    ("inactive", "Inactive", "#ff0000"),
                    ("pending", "Pending", "#ffff00"),
                ],
                default="active",
                max_length=255,
            ),
        ),
        migrations.AddField(
            model_name="parent",
            name="updated_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="%(class)s_updated",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.CreateModel(
            name="Many",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                (
                    "avatar",
                    models.ImageField(blank=True, null=True, upload_to="avatars/"),
                ),
                ("name", models.CharField(max_length=255)),
                ("age", models.IntegerField(default=71)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "date",
                    models.DateField(
                        default=bloomerp_tests.models.generate_random_date
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="%(class)s_created",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "updated_by",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="%(class)s_updated",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
                "default_permissions": (
                    "add",
                    "change",
                    "delete",
                    "view",
                    "bulk_change",
                    "bulk_delete",
                    "bulk_add",
                    "export",
                ),
            },
        ),
        migrations.AddField(
            model_name="child",
            name="many_to_many_with_related_name",
            field=models.ManyToManyField(
                related_name="children", to="bloomerp_tests.many"
            ),
        ),
        migrations.AddField(
            model_name="child",
            name="many_to_many_without_related_name",
            field=models.ManyToManyField(to="bloomerp_tests.many"),
        ),
    ]
