# Generated by Django 4.2.1 on 2025-06-10 22:22

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Engine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('source', models.CharField(max_length=1024)),
                ('sha', models.CharField(max_length=64)),
                ('bench', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='LogEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author', models.CharField(max_length=128)),
                ('summary', models.CharField(max_length=128)),
                ('log_file', models.CharField(max_length=128)),
                ('machine_id', models.IntegerField(default=0)),
                ('test_id', models.IntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Machine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mnps', models.FloatField(default=0.0)),
                ('dev_mnps', models.FloatField(default=0.0)),
                ('base_mnps', models.FloatField(default=0.0)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('secret', models.CharField(default='None', max_length=64)),
                ('info', models.JSONField()),
                ('workload', models.IntegerField(default=0)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='owner', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Network',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default', models.BooleanField(default=False)),
                ('was_default', models.BooleanField(default=False)),
                ('sha256', models.CharField(max_length=8)),
                ('name', models.CharField(max_length=64)),
                ('engine', models.CharField(max_length=64)),
                ('author', models.CharField(max_length=64)),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='PGN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('test_id', models.IntegerField(default=0)),
                ('result_id', models.IntegerField(default=0)),
                ('book_index', models.IntegerField(default=0)),
                ('processed', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author', models.CharField(max_length=64)),
                ('upload_pgns', models.CharField(default='FALSE', max_length=16)),
                ('book_name', models.CharField(max_length=32)),
                ('book_index', models.IntegerField(default=1)),
                ('dev_repo', models.CharField(max_length=1024)),
                ('dev_engine', models.CharField(max_length=64)),
                ('dev_options', models.CharField(max_length=256)),
                ('dev_network', models.CharField(blank=True, max_length=256)),
                ('dev_netname', models.CharField(blank=True, max_length=256)),
                ('dev_time_control', models.CharField(max_length=32)),
                ('base_repo', models.CharField(max_length=1024)),
                ('base_engine', models.CharField(max_length=64)),
                ('base_options', models.CharField(max_length=256)),
                ('base_network', models.CharField(blank=True, max_length=256)),
                ('base_netname', models.CharField(blank=True, max_length=256)),
                ('base_time_control', models.CharField(max_length=32)),
                ('workload_size', models.IntegerField(default=32)),
                ('priority', models.IntegerField(default=0)),
                ('throughput', models.IntegerField(default=0)),
                ('scale_method', models.CharField(choices=[('DEV', 'DEV'), ('BASE', 'BASE'), ('BOTH', 'BOTH')], default='BASE', max_length=16)),
                ('scale_nps', models.IntegerField(default=0)),
                ('syzygy_wdl', models.CharField(default='OPTIONAL', max_length=16)),
                ('syzygy_adj', models.CharField(default='OPTIONAL', max_length=16)),
                ('win_adj', models.CharField(default='movecount=3 score=400', max_length=64)),
                ('draw_adj', models.CharField(default='movenumber=40 movecount=8 score=10', max_length=64)),
                ('test_mode', models.CharField(default='SPRT', max_length=16)),
                ('elolower', models.FloatField(default=0.0)),
                ('eloupper', models.FloatField(default=0.0)),
                ('alpha', models.FloatField(default=0.0)),
                ('beta', models.FloatField(default=0.0)),
                ('lowerllr', models.FloatField(default=0.0)),
                ('currentllr', models.FloatField(default=0.0)),
                ('upperllr', models.FloatField(default=0.0)),
                ('max_games', models.IntegerField(default=0)),
                ('spsa', models.JSONField(blank=True, default=dict, null=True)),
                ('genfens_args', models.CharField(blank=True, default='', max_length=256)),
                ('play_reverses', models.BooleanField(default=False)),
                ('games', models.IntegerField(default=0)),
                ('losses', models.IntegerField(default=0)),
                ('draws', models.IntegerField(default=0)),
                ('wins', models.IntegerField(default=0)),
                ('LL', models.IntegerField(default=0)),
                ('LD', models.IntegerField(default=0)),
                ('DD', models.IntegerField(default=0)),
                ('DW', models.IntegerField(default=0)),
                ('WW', models.IntegerField(default=0)),
                ('use_tri', models.BooleanField(default=False)),
                ('use_penta', models.BooleanField(default=True)),
                ('passed', models.BooleanField(default=False)),
                ('failed', models.BooleanField(default=False)),
                ('finished', models.BooleanField(default=False)),
                ('deleted', models.BooleanField(default=False)),
                ('approved', models.BooleanField(default=False)),
                ('awaiting', models.BooleanField(default=False)),
                ('error', models.BooleanField(default=False)),
                ('creation', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('base', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='base', to='OpenBench.engine')),
                ('dev', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dev', to='OpenBench.engine')),
            ],
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated', models.DateTimeField(auto_now=True)),
                ('losses', models.IntegerField(default=0)),
                ('draws', models.IntegerField(default=0)),
                ('wins', models.IntegerField(default=0)),
                ('LL', models.IntegerField(default=0)),
                ('LD', models.IntegerField(default=0)),
                ('DD', models.IntegerField(default=0)),
                ('DW', models.IntegerField(default=0)),
                ('WW', models.IntegerField(default=0)),
                ('games', models.IntegerField(default=0)),
                ('crashes', models.IntegerField(default=0)),
                ('timeloss', models.IntegerField(default=0)),
                ('machine', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='machine', to='OpenBench.machine')),
                ('test', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='test', to='OpenBench.test')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('games', models.IntegerField(default=0)),
                ('tests', models.IntegerField(default=0)),
                ('repos', models.JSONField(blank=True, default=dict, null=True)),
                ('engine', models.CharField(blank=True, max_length=128)),
                ('enabled', models.BooleanField(default=False)),
                ('approver', models.BooleanField(default=False)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
