# Generated by Django 5.2.9 on 2025-12-14 15:11

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


class Migration(migrations.Migration):

    dependencies = [
        ("repos", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="RepositoryIssue",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("number", models.PositiveIntegerField()),
                ("title", models.CharField(max_length=500)),
                ("state", models.CharField(max_length=50)),
                ("html_url", models.URLField(blank=True)),
                ("api_url", models.URLField(blank=True)),
                ("author", models.CharField(blank=True, max_length=255)),
                ("created_at", models.DateTimeField()),
                ("updated_at", models.DateTimeField()),
                (
                    "repository",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="issues",
                        to="repos.githubrepository",
                    ),
                ),
            ],
            options={
                "verbose_name": "Repository Issue",
                "verbose_name_plural": "Repository Issues",
                "ordering": ("-updated_at", "-created_at"),
                "constraints": [
                    models.UniqueConstraint(
                        fields=("repository", "number"),
                        name="unique_issue_per_repository",
                    )
                ],
            },
        ),
        migrations.CreateModel(
            name="RepositoryPullRequest",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("number", models.PositiveIntegerField()),
                ("title", models.CharField(max_length=500)),
                ("state", models.CharField(max_length=50)),
                ("html_url", models.URLField(blank=True)),
                ("api_url", models.URLField(blank=True)),
                ("author", models.CharField(blank=True, max_length=255)),
                ("created_at", models.DateTimeField()),
                ("updated_at", models.DateTimeField()),
                ("merged_at", models.DateTimeField(blank=True, null=True)),
                ("source_branch", models.CharField(blank=True, max_length=255)),
                ("target_branch", models.CharField(blank=True, max_length=255)),
                ("is_draft", models.BooleanField(default=False)),
                (
                    "repository",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="pull_requests",
                        to="repos.githubrepository",
                    ),
                ),
            ],
            options={
                "verbose_name": "Repository Pull Request",
                "verbose_name_plural": "Repository Pull Requests",
                "ordering": ("-updated_at", "-created_at"),
                "constraints": [
                    models.UniqueConstraint(
                        fields=("repository", "number"),
                        name="unique_pull_request_per_repository",
                    )
                ],
            },
        ),
    ]
