# Generated by Django 3.1.7 on 2022-03-27 13:03

import django.core.files.storage
import django.db.models.deletion
from django.db import migrations, models

import thunderstore.cache.models
import thunderstore.core.mixins
import thunderstore.utils.makemigrations


class Migration(migrations.Migration):

    dependencies = [
        ("community", "0018_add_package_rejection_reason"),
        ("repository", "0032_package_namespace_non_nullable"),
    ]

    operations = [
        migrations.CreateModel(
            name="APIV1PackageCache",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "data",
                    models.FileField(
                        blank=True,
                        null=True,
                        storage=thunderstore.utils.makemigrations.StubStorage(),
                        upload_to=thunderstore.core.mixins.get_package_cache_filepath,
                    ),
                ),
                ("content_type", models.TextField()),
                ("content_encoding", models.TextField()),
                ("last_modified", models.DateTimeField()),
                ("is_deleted", models.BooleanField(default=False)),
                (
                    "community",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="package_list_cache",
                        to="community.community",
                        blank=True,
                        null=True,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddIndex(
            model_name="apiv1packagecache",
            index=models.Index(
                fields=["last_modified"], name="repository__last_mo_831df1_idx"
            ),
        ),
    ]
