# Generated by Django 5.2.4 on 2025-11-20 13:14

import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("posts", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="CommentDislike",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name="CommentLike",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.AlterModelOptions(
            name="comment",
            options={"ordering": ["created_at"]},
        ),
        migrations.AlterModelOptions(
            name="post",
            options={"ordering": ["-created_at"]},
        ),
        migrations.AddField(
            model_name="comment",
            name="updated_at",
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddIndex(
            model_name="comment",
            index=models.Index(
                fields=["post", "created_at"], name="posts_comme_post_id_94ac6b_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="comment",
            index=models.Index(fields=["user"], name="posts_comme_user_id_5151d7_idx"),
        ),
        migrations.AddIndex(
            model_name="like",
            index=models.Index(
                fields=["post", "user"], name="posts_like_post_id_d262ec_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="love",
            index=models.Index(
                fields=["post", "user"], name="posts_love_post_id_f24ede_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="post",
            index=models.Index(
                fields=["-created_at"], name="posts_post_created_183a3b_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="post",
            index=models.Index(fields=["author"], name="posts_post_author__19d68b_idx"),
        ),
        migrations.AddField(
            model_name="commentdislike",
            name="comment",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="comment_dislikes",
                to="posts.comment",
            ),
        ),
        migrations.AddField(
            model_name="commentdislike",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="comment_dislikes",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="commentlike",
            name="comment",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="comment_likes",
                to="posts.comment",
            ),
        ),
        migrations.AddField(
            model_name="commentlike",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="comment_likes",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddIndex(
            model_name="commentdislike",
            index=models.Index(
                fields=["comment", "user"], name="posts_comme_comment_0f9fd6_idx"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="commentdislike",
            unique_together={("user", "comment")},
        ),
        migrations.AddIndex(
            model_name="commentlike",
            index=models.Index(
                fields=["comment", "user"], name="posts_comme_comment_019ec3_idx"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="commentlike",
            unique_together={("user", "comment")},
        ),
    ]
