# Generated by Django 5.2.1 on 2025-06-05 21:58

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.AlterModelOptions(
            name="membership",
            options={},
        ),
        migrations.AlterUniqueTogether(
            name="membership",
            unique_together=set(),
        ),
        migrations.CreateModel(
            name="Post",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(
                        blank=True, max_length=200, null=True, verbose_name="帖子标题"
                    ),
                ),
                ("content", models.TextField(verbose_name="帖子内容")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="发布时间"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="更新时间"),
                ),
                (
                    "author",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="posts",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="作者",
                    ),
                ),
                (
                    "group",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="posts",
                        to="groups.group",
                        verbose_name="所属小组",
                    ),
                ),
            ],
            options={
                "verbose_name": "帖子/动态",
                "verbose_name_plural": "帖子/动态们",
                "ordering": ["-created_at"],
            },
        ),
    ]
