# Generated by Django 3.0.4 on 2020-09-04 06:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("repository", "0022_add_package_listing"),
    ]

    operations = [
        migrations.CreateModel(
            name="PackageCategory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                ("name", models.CharField(max_length=512)),
                ("slug", models.SlugField(unique=True)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PackageListing",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                ("has_nsfw_content", models.BooleanField(default=False)),
                (
                    "categories",
                    models.ManyToManyField(
                        blank=True,
                        related_name="packages",
                        to="community.PackageCategory",
                    ),
                ),
                (
                    "package",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="package_listings",
                        to="repository.Package",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
