# Generated by Django 6.0.5 on 2026-08-05 11:49

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


class Migration(migrations.Migration):

    dependencies = [
        ("wallet", "0004_coinflip"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="TicTacToe",
            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="X", max_length=1)),
                ("winner", models.CharField(blank=True, max_length=1, null=True)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("waiting", "Waiting for opponent"),
                            ("playing", "In Progress"),
                            ("finished", "Finished"),
                            ("cancelled", "Cancelled"),
                        ],
                        default="waiting",
                        max_length=20,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "player_o",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ttt_as_o",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "player_x",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ttt_as_x",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
    ]
