# Generated by Django 3.1.7 on 2024-05-21 12:09

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


class Migration(migrations.Migration):

    dependencies = [
        ("community", "0028_add_cover_image_fields"),
        ("storage", "0002_add_group"),
        ("repository", "0051_bigint_file_size"),
    ]

    operations = [
        migrations.CreateModel(
            name="APIV1ChunkedPackageCache",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_deleted", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "chunks",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="chunked_package_list_cache",
                        to="storage.datablobgroup",
                    ),
                ),
                (
                    "community",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="chunked_package_list_cache",
                        to="community.community",
                    ),
                ),
                (
                    "index",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="chunked_package_indexes",
                        to="storage.datablob",
                    ),
                ),
            ],
            options={
                "get_latest_by": "created_at",
            },
        ),
    ]
