# Generated by Django on initial setup
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="PublicBody",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(max_length=255, unique=True)),
                ("slug", models.SlugField(max_length=255, unique=True)),
                ("website", models.URLField(blank=True)),
                ("description", models.TextField(blank=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "verbose_name": "Gemeinde",
                "verbose_name_plural": "Gemeinden",
                "ordering": ["name"],
            },
        ),
        migrations.CreateModel(
            name="Party",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("name", models.CharField(max_length=255, unique=True)),
                ("abbreviation", models.CharField(blank=True, max_length=50)),
                ("color", models.CharField(blank=True, help_text="Hex-Farbe, z. B. #00AAFF", max_length=7)),
            ],
            options={
                "verbose_name": "Partei",
                "verbose_name_plural": "Parteien",
                "ordering": ["name"],
            },
        ),
        migrations.CreateModel(
            name="Member",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("first_name", models.CharField(max_length=150)),
                ("last_name", models.CharField(max_length=150)),
                ("email", models.EmailField(blank=True, max_length=254)),
                (
                    "party",
                    models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="members", to="council.party"),
                ),
                (
                    "public_body",
                    models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="members", to="council.publicbody"),
                ),
            ],
            options={
                "verbose_name": "Stadträt:in",
                "verbose_name_plural": "Stadträt:innen",
                "ordering": ["last_name", "first_name"],
                "unique_together": {("first_name", "last_name", "public_body")},
            },
        ),
        migrations.CreateModel(
            name="Question",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("title", models.CharField(max_length=255)),
                ("body", models.TextField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "member",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="questions", to="council.member"),
                ),
            ],
            options={
                "verbose_name": "Frage",
                "verbose_name_plural": "Fragen",
                "ordering": ["-created_at"],
            },
        ),
        migrations.CreateModel(
            name="Answer",
            fields=[
                ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("body", models.TextField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "answered_by",
                    models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="answers", to="council.member"),
                ),
                (
                    "question",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name="answers", to="council.question"),
                ),
            ],
            options={
                "verbose_name": "Antwort",
                "verbose_name_plural": "Antworten",
                "ordering": ["created_at"],
            },
        ),
    ] 