# Generated by Django 5.1.1 on 2024-09-15 20:25

import bloomerp.models
import django.contrib.auth.models
import django.contrib.auth.validators
import django.db.models.deletion
import django.utils.timezone
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("auth", "0012_alter_user_first_name_max_length"),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.CreateModel(
            name="User",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("password", models.CharField(max_length=128, verbose_name="password")),
                (
                    "last_login",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="last login"
                    ),
                ),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text="Designates that this user has all permissions without explicitly assigning them.",
                        verbose_name="superuser status",
                    ),
                ),
                (
                    "username",
                    models.CharField(
                        error_messages={
                            "unique": "A user with that username already exists."
                        },
                        help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
                        max_length=150,
                        unique=True,
                        validators=[
                            django.contrib.auth.validators.UnicodeUsernameValidator()
                        ],
                        verbose_name="username",
                    ),
                ),
                (
                    "first_name",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="first name"
                    ),
                ),
                (
                    "last_name",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="last name"
                    ),
                ),
                (
                    "email",
                    models.EmailField(
                        blank=True, max_length=254, verbose_name="email address"
                    ),
                ),
                (
                    "is_staff",
                    models.BooleanField(
                        default=False,
                        help_text="Designates whether the user can log into this admin site.",
                        verbose_name="staff status",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True,
                        help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
                        verbose_name="active",
                    ),
                ),
                (
                    "date_joined",
                    models.DateTimeField(
                        default=django.utils.timezone.now, verbose_name="date joined"
                    ),
                ),
                ("avatar", models.ImageField(null=True, upload_to="users/")),
                (
                    "file_view_preference",
                    models.CharField(
                        choices=[("card", "Card View"), ("list", "List View")],
                        default="card",
                        max_length=20,
                    ),
                ),
                (
                    "date_view_preference",
                    models.CharField(
                        choices=[
                            ("d-m-Y", "Day-Month-Year (15-08-2000)"),
                            ("m-d-Y", "Month-Day-Year (08-15-2000)"),
                            ("Y-m-d", "Year-Month-Day (2000-08-15)"),
                        ],
                        default="d-m-Y",
                        max_length=20,
                    ),
                ),
                (
                    "datetime_view_preference",
                    models.CharField(
                        choices=[
                            (
                                "d-m-Y H:i",
                                "Day-Month-Year Hour:Minute (15-08-2000 12:30)",
                            ),
                            (
                                "m-d-Y H:i",
                                "Month-Day-Year Hour:Minute (08-15-2000 12:30)",
                            ),
                            (
                                "Y-m-d H:i",
                                "Year-Month-Day Hour:Minute (2000-08-15 12:30)",
                            ),
                        ],
                        default="d-m-Y H:i",
                        max_length=20,
                    ),
                ),
                (
                    "groups",
                    models.ManyToManyField(
                        blank=True,
                        help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
                        related_name="user_set",
                        related_query_name="user",
                        to="auth.group",
                        verbose_name="groups",
                    ),
                ),
                (
                    "user_permissions",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Specific permissions for this user.",
                        related_name="user_set",
                        related_query_name="user",
                        to="auth.permission",
                        verbose_name="user permissions",
                    ),
                ),
            ],
            options={
                "db_table": "auth_user",
            },
            managers=[
                ("objects", django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name="ApplicationField",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("field", models.CharField(max_length=100)),
                (
                    "field_type",
                    models.CharField(
                        choices=[
                            ("Property", "Property"),
                            ("AutoField", "AutoField"),
                            ("ForeignKey", "ForeignKey"),
                            ("FileField", "FileField"),
                            ("ImageField", "ImageField"),
                            ("CharField", "CharField"),
                            ("TextField", "TextField"),
                            ("IntegerField", "IntegerField"),
                            ("FloatField", "FloatField"),
                            ("DecimalField", "DecimalField"),
                            ("BooleanField", "BooleanField"),
                            ("DateField", "DateField"),
                            ("DateTimeField", "DateTimeField"),
                            ("TimeField", "TimeField"),
                            ("DurationField", "DurationField"),
                            ("EmailField", "EmailField"),
                            ("URLField", "URLField"),
                            ("UUIDField", "UUIDField"),
                            ("GenericIPAddressField", "GenericIPAddressField"),
                            ("SlugField", "SlugField"),
                            ("PositiveIntegerField", "PositiveIntegerField"),
                            ("PositiveSmallIntegerField", "PositiveSmallIntegerField"),
                            ("BigIntegerField", "BigIntegerField"),
                            ("SmallIntegerField", "SmallIntegerField"),
                            ("BinaryField", "BinaryField"),
                            ("IPAddressField", "IPAddressField"),
                            ("AutoField", "AutoField"),
                            ("BigAutoField", "BigAutoField"),
                            ("SmallAutoField", "SmallAutoField"),
                            ("NullBooleanField", "NullBooleanField"),
                            ("OneToOneField", "OneToOneField"),
                            ("ManyToManyField", "ManyToManyField"),
                            ("ArrayField", "ArrayField"),
                            ("JSONField", "JSONField"),
                            ("HStoreField", "HStoreField"),
                            ("BinaryField", "BinaryField"),
                            ("UUIDField", "UUIDField"),
                            ("ForeignKey", "ForeignKey"),
                            ("OneToOneField", "OneToOneField"),
                            ("ManyToManyField", "ManyToManyField"),
                            ("GenericRelation", "GenericRelation"),
                            ("GenericForeignKey", "GenericForeignKey"),
                            ("ForeignKey", "ForeignKey"),
                            ("OneToOneField", "OneToOneField"),
                            ("ManyToManyField", "ManyToManyField"),
                            ("GenericRelation", "GenericRelation"),
                            ("GenericForeignKey", "GenericForeignKey"),
                            ("ForeignKey", "ForeignKey"),
                            ("OneToOneField", "OneToOneField"),
                            ("ManyToManyField", "ManyToManyField"),
                            ("GenericRelation", "GenericRelation"),
                            ("GenericForeignKey", "GenericForeignKey"),
                        ],
                        max_length=100,
                    ),
                ),
                ("meta", models.JSONField(blank=True, null=True)),
                ("db_table", models.CharField(blank=True, max_length=100, null=True)),
                (
                    "db_field_type",
                    models.CharField(blank=True, max_length=100, null=True),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_application_field",
                "managed": True,
            },
        ),
        migrations.CreateModel(
            name="File",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "file",
                    models.FileField(upload_to=bloomerp.models.File.upload_to),
                ),
                ("name", models.CharField(blank=True, max_length=100, null=True)),
                ("object_id", models.PositiveIntegerField(blank=True, null=True)),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("meta", models.JSONField(blank=True, null=True)),
                (
                    "content_type",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "uploaded_by",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_file",
                "managed": True,
            },
        ),
    ]
