# Generated by Django 5.1.2 on 2024-12-22 20:38

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


class Migration(migrations.Migration):

    dependencies = [
        ("bookshelf", "0016_basebook_book_catalogue"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="basebook",
            options={},
        ),
        migrations.CreateModel(
            name="BaseBookDocument",
            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(
                        storage=ram.utils.DeduplicatedStorage(), upload_to="files/"
                    ),
                ),
                ("private", models.BooleanField(default=False)),
                (
                    "book",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="document",
                        to="bookshelf.basebook",
                    ),
                ),
            ],
            options={
                "unique_together": {("book", "file")},
            },
        ),
    ]
