# Generated by Django 3.2.15 on 2022-08-30 06:31

import uuid

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('for_runners', '0010_participationmodel_person2user'),
    ]

    operations = [
        migrations.CreateModel(
            name='ParticipationFileModel',
            fields=[
                (
                    'createtime',
                    models.DateTimeField(
                        default=django.utils.timezone.now, editable=False, help_text='Create time'
                    ),
                ),
                (
                    'lastupdatetime',
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        editable=False,
                        help_text='Time of the last change.',
                    ),
                ),
                (
                    'id',
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        help_text='ParticipationFileModel.id.help_text',
                        primary_key=True,
                        serialize=False,
                        verbose_name='ParticipationFileModel.id.verbose_name',
                    ),
                ),
                (
                    'name',
                    models.CharField(
                        blank=True,
                        help_text='ParticipationFileModel.name.help_text',
                        max_length=255,
                        null=True,
                        verbose_name='ParticipationFileModel.name.verbose_name',
                    ),
                ),
                ('position', models.PositiveSmallIntegerField(default=0)),
                (
                    'file',
                    models.FileField(
                        help_text='ParticipationFileModel.file.help_text',
                        upload_to=django_tools.serve_media_app.models.user_directory_path,
                        verbose_name='ParticipationFileModel.file.verbose_name',
                    ),
                ),
                (
                    'participation',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='for_runners.participationmodel',
                    ),
                ),
                (
                    'user',
                    models.ForeignKey(
                        editable=False,
                        help_text='ParticipationFileModel.user.help_text',
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='+',
                        to=settings.AUTH_USER_MODEL,
                        verbose_name='ParticipationFileModel.user.verbose_name',
                    ),
                ),
            ],
            options={
                'verbose_name': 'ParticipationFileModel.verbose_name',
                'verbose_name_plural': 'ParticipationFileModel.verbose_name_plural',
                'ordering': ('position',),
            },
        ),
    ]
