# Generated by Django 4.2 on 2023-09-30 21:54

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


class Migration(migrations.Migration):

    dependencies = [
        ("metadata", "0011_company_slug_and_more"),
    ]

    operations = [
        migrations.AlterField(
            model_name="decoder",
            name="manufacturer",
            field=models.ForeignKey(
                limit_choices_to={"category": "accessory"},
                on_delete=django.db.models.deletion.CASCADE,
                to="metadata.manufacturer",
            ),
        ),
        migrations.CreateModel(
            name="DecoderDocument",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("description", models.CharField(blank=True, max_length=128)),
                (
                    "file",
                    models.FileField(
                        blank=True,
                        null=True,
                        storage=ram.utils.DeduplicatedStorage(),
                        upload_to="files/",
                    ),
                ),
                (
                    "decoder",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="document",
                        to="metadata.decoder",
                    ),
                ),
            ],
            options={
                "unique_together": {("decoder", "file")},
            },
        ),
    ]
