# Generated by Django 2.1.7 on 2019-03-04 02:57

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('challenge', '0002_auto_20190228_0540'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserLeaderboard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lb_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('lb_score', models.DecimalField(blank=True, decimal_places=6, default=0.0, help_text='last score of user on contest', max_digits=10)),
                ('lb_sub_count', models.IntegerField(default=0, help_text='user submissions count')),
                ('lb_sub_count_period', models.IntegerField(default=0, help_text='user submissions count for last period')),
                ('lb_rank', models.CharField(choices=[('g', 'gold'), ('s', 'silver'), ('b', 'bronze'), ('u', 'unranked')], default='u', help_text='rank of user for contest', max_length=1)),
                ('contest', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contest_lb', to='challenge.Contest')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='user_lb', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='userleaderboard',
            unique_together={('user', 'contest')},
        ),
    ]
