# Generated by Django 3.1.14 on 2022-07-15 21:19

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

import api.models.person


class Migration(migrations.Migration):
    dependencies = [
        ("api", "0025_add_cover_photo"),
    ]

    operations = [
        migrations.AlterModelManagers(
            name="albumdate",
            managers=[
                ("visible", django.db.models.manager.Manager()),
            ],
        ),
        migrations.RemoveField(
            model_name="person",
            name="cluster_id",
        ),
        migrations.AlterField(
            model_name="person",
            name="mean_face_encoding",
            field=models.TextField(default="default"),
        ),
        migrations.RemoveField(
            model_name="person",
            name="mean_face_encoding",
        ),
        migrations.AlterField(
            model_name="longrunningjob",
            name="job_type",
            field=models.PositiveIntegerField(
                choices=[
                    (1, "Scan Photos"),
                    (2, "Generate Event Albums"),
                    (3, "Regenerate Event Titles"),
                    (4, "Train Faces"),
                    (5, "Delete Missing Photos"),
                    (7, "Scan Faces"),
                    (6, "Calculate Clip Embeddings"),
                    (8, "Find Similar Faces"),
                ]
            ),
        ),
        migrations.CreateModel(
            name="Cluster",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("mean_face_encoding", models.TextField()),
                ("cluster_id", models.IntegerField(null=True)),
                ("name", models.TextField(null=True)),
                (
                    "person",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=models.SET(api.models.person.get_unknown_person),
                        related_name="clusters",
                        to="api.person",
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=models.SET(api.models.user.get_deleted_user),
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="face",
            name="cluster",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=models.SET(api.models.cluster.get_unknown_cluster),
                related_name="faces",
                to="api.cluster",
            ),
        ),
        migrations.AddField(
            model_name="person",
            name="cluster_owner",
            field=models.ForeignKey(
                default=None,
                null=True,
                related_name="owner",
                on_delete=models.SET(api.models.user.get_deleted_user),
                to=settings.AUTH_USER_MODEL,
            ),
        ),
    ]
