# Generated by Django 6.0.5 on 2026-05-22 05:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="CodeReview",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "language",
                    models.CharField(
                        choices=[
                            ("python", "Python"),
                            ("javascript", "JavaScript"),
                            ("java", "Java"),
                            ("cpp", "C++"),
                            ("csharp", "C#"),
                            ("go", "Go"),
                            ("rust", "Rust"),
                            ("php", "PHP"),
                            ("html", "HTML"),
                            ("css", "CSS"),
                            ("sql", "SQL"),
                            ("django", "Django"),
                        ],
                        max_length=100,
                    ),
                ),
                ("code", models.TextField()),
                ("ai_review", models.TextField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "score_security",
                    models.IntegerField(
                        default=0, help_text="Security Score out of 10"
                    ),
                ),
                (
                    "score_performance",
                    models.IntegerField(
                        default=0, help_text="Performance Score out of 10"
                    ),
                ),
                (
                    "score_readability",
                    models.IntegerField(
                        default=0, help_text="Readability Score out of 10"
                    ),
                ),
                (
                    "score_overall",
                    models.IntegerField(default=0, help_text="Overall Score out of 10"),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="reviews",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
    ]
