# Generated by Django 2.2.9 on 2020-02-04 02:08

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('problem', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, unique=True, verbose_name='名字')),
                ('ip', models.CharField(max_length=30, verbose_name='IP')),
                ('port', models.IntegerField(verbose_name='端口号')),
                ('token', models.CharField(max_length=192, verbose_name='密钥')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('last_seen_time', models.DateTimeField(auto_now=True)),
                ('last_synchronize_time', models.DateTimeField(null=True)),
                ('enabled', models.BooleanField(default=False)),
                ('concurrency', models.PositiveIntegerField(default=1, verbose_name='并发量')),
                ('runtime_multiplier', models.FloatField(default=1, verbose_name='运行时间调整系数')),
                ('version', models.PositiveIntegerField(verbose_name='判题机版本')),
                ('master', models.BooleanField(default=True, verbose_name='主节点')),
            ],
            options={
                'ordering': ['last_seen_time'],
            },
        ),
        migrations.CreateModel(
            name='ServerProblemStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_status', models.TextField(blank=True)),
                ('last_synchronize', models.DateTimeField(auto_now=True)),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='problem.Problem')),
                ('server', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dispatcher.Server')),
            ],
            options={
                'unique_together': {('server', 'problem')},
            },
        ),
    ]
