# Generated by Django 3.1.7 on 2021-05-22 15:18

import django.db.models.deletion
import ulid2
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="UserMedia",
            fields=[
                ("datetime_created", models.DateTimeField(auto_now_add=True)),
                ("datetime_updated", models.DateTimeField(auto_now=True)),
                ("filename", models.CharField(max_length=1024)),
                ("key", models.CharField(max_length=2048)),
                ("size", models.PositiveIntegerField()),
                (
                    "uuid",
                    models.UUIDField(
                        default=ulid2.generate_ulid_as_uuid,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("prefix", models.CharField(blank=True, max_length=256, null=True)),
                ("expiry", models.DateTimeField(blank=True, null=True)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("initial", "initial"),
                            ("upload_created", "upload_initiated"),
                            ("upload_error", "upload_error"),
                            ("upload_complete", "upload_complete"),
                            ("upload_aborted", "upload_aborted"),
                        ],
                        default="initial",
                        max_length=64,
                    ),
                ),
                ("upload_id", models.TextField(blank=True, null=True)),
                (
                    "owner",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="usermedia",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "user media",
                "verbose_name_plural": "user media",
            },
        ),
    ]
