# Generated by Django 3.2 on 2021-07-19 11:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('communities', '0001_initial'),
        ('quizzes', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tournament',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('time_updated', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=False)),
                ('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tournaments', to='communities.community')),
            ],
            options={
                'db_table': 'tournaments',
            },
        ),
        migrations.CreateModel(
            name='Round',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_time', models.DateTimeField()),
                ('finish_time', models.DateTimeField()),
                ('quiz', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='quizzes.quiz')),
                ('tournament', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rounds', to='tournaments.tournament')),
            ],
            options={
                'db_table': 'rounds',
            },
        ),
        migrations.AddIndex(
            model_name='tournament',
            index=models.Index(fields=['time_created'], name='tournaments_time_cr_ccbf5a_idx'),
        ),
        migrations.AddIndex(
            model_name='round',
            index=models.Index(fields=['finish_time'], name='rounds_finish__8ea428_idx'),
        ),
    ]
