# Generated by Django 5.0rc1 on 2023-11-29 17:55

import django.contrib.postgres.indexes
import django.db.models.deletion
import django.db.models.functions.datetime
import django_ltree.fields
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("anime", "0023_alter_animegenremodel_is_locked_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="AnimeCommentModel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("path", django_ltree.fields.PathField(unique=True)),
                (
                    "created_at",
                    models.DateTimeField(
                        db_default=django.db.models.functions.datetime.Now()
                    ),
                ),
                ("text", models.TextField()),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Anime Comment",
                "verbose_name_plural": "Anime Comments",
            },
        ),
        migrations.AddField(
            model_name="animemodel",
            name="comments",
            field=models.ManyToManyField(blank=True, to="anime.animecommentmodel"),
        ),
        migrations.AddIndex(
            model_name="animecommentmodel",
            index=django.contrib.postgres.indexes.GistIndex(
                fields=["path"], name="anime_anime_path_d71277_gist"
            ),
        ),
    ]
