# Generated by Django 4.0 on 2021-12-25 19:17

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("accounts", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Scheme",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=50, verbose_name="Title")),
                (
                    "separator",
                    models.CharField(
                        choices=[(".", "Point (.)"), (",", "Coma (,)")],
                        max_length=5,
                        verbose_name="Column separator",
                    ),
                ),
                (
                    "character",
                    models.CharField(
                        choices=[(".", "Point (.)"), (",", "Coma (,)")],
                        max_length=5,
                        verbose_name="Column separator",
                    ),
                ),
                (
                    "file",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=services.generators.generate_file_path,
                        verbose_name="File",
                    ),
                ),
                (
                    "uuid",
                    models.UUIDField(
                        db_index=True,
                        default=services.generators.generate_uuid,
                        unique=True,
                    ),
                ),
                (
                    "created_date",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created"),
                ),
                (
                    "modified_date",
                    models.DateTimeField(auto_now=True, verbose_name="Modified"),
                ),
                (
                    "is_waiting",
                    models.BooleanField(default=True, verbose_name="Waiting"),
                ),
                (
                    "is_processing",
                    models.BooleanField(default=False, verbose_name="Processing"),
                ),
                ("is_ready", models.BooleanField(default=False, verbose_name="Ready")),
                (
                    "is_failed",
                    models.BooleanField(default=False, verbose_name="Failed"),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="scheme",
                        to="accounts.customuser",
                        verbose_name="User",
                    ),
                ),
            ],
            options={
                "verbose_name": "Scheme",
                "verbose_name_plural": "Schemas",
            },
        ),
        migrations.CreateModel(
            name="Column",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=50, verbose_name="Column name")),
                (
                    "kind",
                    models.CharField(
                        choices=[
                            ("Full Name", "Full Name"),
                            ("Job", "Job"),
                            ("Email", "Email"),
                            ("Domain name", "Domain name"),
                            ("Phone number", "Phone number"),
                            ("Company name", "Company name"),
                            ("Text", "Text"),
                            ("Integer", "Integer"),
                            ("Address", "Address"),
                            ("Date", "Date"),
                        ],
                        max_length=20,
                        verbose_name="Type",
                    ),
                ),
                ("order", models.SmallIntegerField(verbose_name="Order")),
                (
                    "scheme",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="column",
                        to="base.scheme",
                        verbose_name="Scheme",
                    ),
                ),
            ],
            options={
                "verbose_name": "Column",
                "verbose_name_plural": "Columns",
            },
        ),
    ]
