# Generated by Django 5.1.1 on 2024-09-16 16:14

import bloomerp.models
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("bloomerp", "0007_alter_file_file"),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.AlterField(
            model_name="file",
            name="file",
            field=models.FileField(upload_to=bloomerp.models.File.upload_to),
        ),
        migrations.AlterModelTable(
            name="kpi",
            table="bloomerp_kpi",
        ),
        migrations.CreateModel(
            name="UserKpiListViewPreference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("position", models.IntegerField(unique=True)),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "kpi",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="bloomerp.kpi"
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="kpi_list_view_preference",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_user_kpi_list_view_preference",
                "managed": True,
            },
        ),
        migrations.CreateModel(
            name="UserDetailViewPreference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "position",
                    models.CharField(
                        choices=[
                            ("LEFT", "Left"),
                            ("CENTER", "Center"),
                            ("RIGHT", "Right"),
                        ],
                        max_length=10,
                    ),
                ),
                (
                    "application_field",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="bloomerp.applicationfield",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="detail_view_preference",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_user_detail_view_preference",
                "managed": True,
                "unique_together": {("user", "application_field")},
            },
        ),
        migrations.CreateModel(
            name="UserKpiDashboardViewPreference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("position", models.IntegerField()),
                (
                    "kpi",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="bloomerp.kpi"
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="kpi_dashboard_view_preference",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_user_kpi_dashboard_view_preference",
                "managed": True,
                "unique_together": {("kpi", "user")},
            },
        ),
        migrations.CreateModel(
            name="UserListViewPreference",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_main", models.BooleanField(default=False)),
                (
                    "application_field",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="bloomerp.applicationfield",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="list_view_preference",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "db_table": "bloomerp_user_list_view_preference",
                "managed": True,
                "unique_together": {("user", "application_field")},
            },
        ),
    ]
