# Generated by Django 3.2.9 on 2024-07-24 05:31

import datetime
from django.conf import settings
import django.contrib.postgres.indexes
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('rog', '0032_alter_location_sub_loc_id'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('category_name', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('category_number', models.IntegerField(unique=True)),
                ('duration', models.DurationField(default=datetime.timedelta(seconds=18000))),
                ('num_of_member', models.IntegerField(default=1)),
                ('family', models.BooleanField(default=False)),
                ('female', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='CheckinImages',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checkinimage', models.FileField(blank=True, null=True, upload_to='checkin/%y%m%d')),
                ('checkintime', models.DateTimeField(verbose_name='Goal time')),
                ('team_name', models.CharField(max_length=255, verbose_name='Team name')),
                ('event_code', models.CharField(max_length=255, verbose_name='event code')),
                ('cp_number', models.IntegerField(verbose_name='CP numner')),
            ],
        ),
        migrations.CreateModel(
            name='Entry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='EntryMember',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_temporary', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='GoalImages',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('goalimage', models.FileField(blank=True, null=True, upload_to='goals/%y%m%d')),
                ('goaltime', models.DateTimeField(verbose_name='Goal time')),
                ('team_name', models.CharField(max_length=255, verbose_name='Team name')),
                ('event_code', models.CharField(max_length=255, verbose_name='event code')),
                ('cp_number', models.IntegerField(verbose_name='CP numner')),
            ],
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_temporary', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='NewEvent',
            fields=[
                ('event_name', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('start_datetime', models.DateTimeField(default=django.utils.timezone.now)),
                ('end_datetime', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('zekken_number', models.CharField(max_length=255, unique=True)),
                ('team_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='TempUser',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=128)),
                ('is_rogaining', models.BooleanField(default=False)),
                ('zekken_number', models.CharField(blank=True, max_length=255, null=True)),
                ('event_code', models.CharField(blank=True, max_length=255, null=True)),
                ('team_name', models.CharField(blank=True, max_length=255, null=True)),
                ('group', models.CharField(max_length=255)),
                ('firstname', models.CharField(blank=True, max_length=255, null=True)),
                ('lastname', models.CharField(blank=True, max_length=255, null=True)),
                ('date_of_birth', models.DateField(blank=True, null=True)),
                ('female', models.BooleanField(default=False)),
                ('verification_code', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('expires_at', models.DateTimeField()),
            ],
        ),
        migrations.DeleteModel(
            name='JpnAdminPerf',
        ),
        migrations.DeleteModel(
            name='JpnSubPerf',
        ),
        migrations.AddField(
            model_name='customuser',
            name='date_of_birth',
            field=models.DateField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='customuser',
            name='event_code',
            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Event Code'),
        ),
        migrations.AddField(
            model_name='customuser',
            name='female',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='customuser',
            name='firstname',
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='customuser',
            name='is_rogaining',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='customuser',
            name='lastname',
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AddField(
            model_name='customuser',
            name='team_name',
            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Team Name'),
        ),
        migrations.AddField(
            model_name='customuser',
            name='zekken_number',
            field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Zekken Number'),
        ),
        migrations.AlterField(
            model_name='customuser',
            name='email',
            field=models.CharField(max_length=255, unique=True, verbose_name='Email'),
        ),
        migrations.AlterField(
            model_name='location',
            name='category',
            field=models.CharField(blank=True, db_index=True, max_length=2048, null=True, verbose_name='Category'),
        ),
        migrations.AlterField(
            model_name='location',
            name='event_active',
            field=models.BooleanField(db_index=True, default=True, verbose_name='Is Event active'),
        ),
        migrations.AlterField(
            model_name='location',
            name='event_name',
            field=models.CharField(blank=True, db_index=True, max_length=2048, null=True, verbose_name='Event name'),
        ),
        migrations.AlterField(
            model_name='location',
            name='group',
            field=models.CharField(blank=True, db_index=True, max_length=2048, null=True, verbose_name='Group'),
        ),
        migrations.AlterField(
            model_name='location',
            name='location_id',
            field=models.IntegerField(blank=True, db_index=True, null=True, verbose_name='Location id'),
        ),
        migrations.AlterField(
            model_name='templocation',
            name='sub_loc_id',
            field=models.CharField(blank=True, max_length=2048, null=True, verbose_name='Sub location id'),
        ),
        migrations.AddIndex(
            model_name='location',
            index=django.contrib.postgres.indexes.GistIndex(fields=['geom'], name='rog_locatio_geom_4793cc_gist'),
        ),
        migrations.AddField(
            model_name='team',
            name='category',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='rog.category'),
        ),
        migrations.AddField(
            model_name='team',
            name='owner',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='owned_teams', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='member',
            name='team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.team'),
        ),
        migrations.AddField(
            model_name='member',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='goalimages',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='entrymember',
            name='entry',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.entry'),
        ),
        migrations.AddField(
            model_name='entrymember',
            name='member',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.member'),
        ),
        migrations.AddField(
            model_name='entry',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.category'),
        ),
        migrations.AddField(
            model_name='entry',
            name='event',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.newevent'),
        ),
        migrations.AddField(
            model_name='entry',
            name='owner',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='entry',
            name='team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.team'),
        ),
        migrations.AddField(
            model_name='checkinimages',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='category',
            unique_together={('category_name', 'category_number')},
        ),
        migrations.AlterUniqueTogether(
            name='team',
            unique_together={('zekken_number', 'category')},
        ),
        migrations.AlterUniqueTogether(
            name='member',
            unique_together={('team', 'user')},
        ),
        migrations.AlterUniqueTogether(
            name='entrymember',
            unique_together={('entry', 'member')},
        ),
        migrations.AlterUniqueTogether(
            name='entry',
            unique_together={('team', 'event', 'date', 'owner')},
        ),
    ]
