# Generated by Django 3.1.14 on 2022-11-09 17:35

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


class Migration(migrations.Migration):
    dependencies = [
        ("api", "0034_allow_deleting_person"),
    ]

    operations = [
        migrations.CreateModel(
            name="File",
            fields=[
                (
                    "hash",
                    models.CharField(max_length=64, primary_key=True, serialize=False),
                ),
                ("path", models.TextField(blank=True, null=True)),
                (
                    "type",
                    models.PositiveIntegerField(
                        blank=True,
                        choices=[
                            (1, "Image"),
                            (2, "Video"),
                            (3, "Metadata File e.g. XMP"),
                            (4, "Raw File"),
                        ],
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="photo",
            name="files",
            field=models.ManyToManyField(to="api.File"),
        ),
        migrations.AddField(
            model_name="photo",
            name="main_file",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="main_photo",
                to="api.file",
            ),
        ),
    ]
