# Generated by Django 2.2.9 on 2020-01-22 16:00

import uuid

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

import grandchallenge.core.storage
import grandchallenge.uploads.models


class Migration(migrations.Migration):
    dependencies = [
        ("challenges", "0022_auto_20200121_1639"),
        ("uploads", "0003_auto_20200120_1753"),
    ]

    operations = [
        migrations.CreateModel(
            name="PublicMedia",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "file",
                    models.FileField(
                        storage=grandchallenge.core.storage.PublicS3Storage(),
                        upload_to=grandchallenge.uploads.models.public_media_filepath,
                    ),
                ),
                (
                    "challenge",
                    models.ForeignKey(
                        blank=True,
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="challenges.Challenge",
                    ),
                ),
            ],
            options={"abstract": False},
        ),
    ]
