# Generated by Django 6.0.5 on 2026-08-07 07:02

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


class Migration(migrations.Migration):

    dependencies = [
        ("wallet", "0006_tictactoe_rematch_of"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Checkers",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("stake", models.PositiveIntegerField(default=0)),
                ("board", models.JSONField(default=list)),
                ("current", models.CharField(default="R", max_length=1)),
                ("winner", models.CharField(blank=True, max_length=1, null=True)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("waiting", "Waiting"),
                            ("playing", "Playing"),
                            ("finished", "Finished"),
                        ],
                        default="waiting",
                        max_length=20,
                    ),
                ),
                ("rematch_of", models.IntegerField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "player_b",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="checkers_as_black",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "player_r",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="checkers_as_red",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
    ]
