# Generated by Django 3.0.1 on 2020-04-08 20:31

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),
        ('Account', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Den',
            fields=[
                ('den_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=20)),
                ('desc', models.CharField(max_length=100)),
                ('avatar', models.ImageField(blank=True, upload_to='image/den/')),
                ('score', models.FloatField(default=0.0, editable=False)),
                ('is_active', models.BooleanField(blank=True, default=True)),
                ('riddle_start_time', models.TimeField(blank=True)),
                ('riddles_per_day', models.IntegerField(blank=True, default=2)),
                ('time_bw_riddle', models.IntegerField(blank=True, default=6)),
                ('started_at', models.DateTimeField(auto_now=True)),
                ('ended_at', models.DateField(blank=True, null=True)),
                ('next_riddle_on', models.DateField(blank=True, null=True)),
                ('invitation_code', models.CharField(blank=True, editable=False, max_length=10)),
                ('uin_code', models.CharField(blank=True, max_length=10)),
                ('admin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DenRiddle',
            fields=[
                ('den_riddle_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('added_at', models.DateTimeField(auto_now=True)),
                ('started_at', models.DateTimeField()),
                ('ending_at', models.DateTimeField()),
                ('is_pending', models.BooleanField(blank=True, default=True)),
                ('is_active', models.BooleanField(blank=True, default=False)),
                ('uin_code', models.CharField(blank=True, max_length=10)),
                ('has_expired', models.BooleanField(blank=True, default=False)),
                ('den', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.Den')),
            ],
        ),
        migrations.CreateModel(
            name='Response',
            fields=[
                ('response_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('answer', models.CharField(max_length=100)),
                ('image', models.ImageField(blank=True, upload_to='image/response/')),
                ('is_correct', models.BooleanField(blank=True, default=False)),
                ('score', models.FloatField(default=0.0)),
                ('response_at', models.DateTimeField(auto_now=True)),
                ('response_time', models.FloatField(default=0.0)),
                ('den_riddle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.DenRiddle')),
                ('hunter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='RiddleCategory',
            fields=[
                ('cat_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=20)),
                ('desc', models.TextField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='RiddleLevel',
            fields=[
                ('level_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=20)),
                ('short_name', models.CharField(max_length=10)),
                ('desc', models.TextField(max_length=100)),
                ('positive_score_percent', models.FloatField(default=1.0)),
                ('negetive_score_percent', models.FloatField(default=0.1)),
                ('time', models.IntegerField(default=30)),
            ],
        ),
        migrations.CreateModel(
            name='RiddleType',
            fields=[
                ('type_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Riddle',
            fields=[
                ('riddle_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('media', models.ImageField(blank=True, upload_to='image/riddle/')),
                ('question', models.CharField(max_length=1000)),
                ('answer_1', models.CharField(max_length=1000)),
                ('answer_2', models.CharField(blank=True, max_length=200)),
                ('answer_3', models.CharField(blank=True, max_length=200)),
                ('answer_4', models.CharField(blank=True, max_length=200)),
                ('answer_5', models.CharField(blank=True, max_length=200)),
                ('answer_6', models.CharField(blank=True, max_length=200)),
                ('answer_7', models.CharField(blank=True, max_length=200)),
                ('answer_8', models.CharField(blank=True, max_length=200)),
                ('answer_9', models.CharField(blank=True, max_length=200)),
                ('point', models.FloatField(blank=True, default=100)),
                ('hint', models.CharField(blank=True, max_length=500)),
                ('answer_format', models.CharField(blank=True, max_length=50)),
                ('uin_code', models.CharField(blank=True, max_length=10)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.RiddleCategory')),
                ('riddle_level', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.RiddleLevel')),
                ('type_riddle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.RiddleType')),
            ],
        ),
        migrations.CreateModel(
            name='ResponseImage',
            fields=[
                ('image_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('image', models.ImageField(blank=True, upload_to='image/response/')),
                ('response', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.Response')),
            ],
        ),
        migrations.CreateModel(
            name='Hunter_Den_Mapping',
            fields=[
                ('map_id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('invitation_code', models.CharField(blank=True, default='NR', max_length=100, null=True)),
                ('member_status', models.BooleanField(blank=True, default=False)),
                ('den', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.Den')),
                ('hunter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Account.UserProfile')),
            ],
        ),
        migrations.AddField(
            model_name='denriddle',
            name='riddle',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.Riddle'),
        ),
        migrations.CreateModel(
            name='DenInvitee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email_to', models.CharField(max_length=50)),
                ('invite_code', models.CharField(max_length=50)),
                ('sent_on', models.DateTimeField(blank=True)),
                ('accepted_on', models.DateTimeField(blank=True, null=True)),
                ('status', models.BooleanField(blank=True, default=False)),
                ('den', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RiddleChamp.Den')),
                ('invitee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Account.UserProfile')),
            ],
        ),
        migrations.AddConstraint(
            model_name='denriddle',
            constraint=models.UniqueConstraint(fields=('den', 'riddle'), name='den_riddle_conposite'),
        ),
    ]
