# Generated by Django 3.2.4 on 2021-06-23 12:56

import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

import ashley.models
import ashley.validators


class Migration(migrations.Migration):

    dependencies = [
        ("forum", "0015_auto_20210217_1351"),
        ("ashley", "0004_auto_20201214_1750"),
    ]

    operations = [
        migrations.CreateModel(
            name="UploadImage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="Creation date"
                    ),
                ),
                (
                    "updated",
                    models.DateTimeField(auto_now=True, verbose_name="Update date"),
                ),
                (
                    "file",
                    models.ImageField(
                        blank=True,
                        upload_to=ashley.models.image_directory_path,
                        validators=[
                            django.core.validators.FileExtensionValidator(
                                ["gif", "jpeg", "jpg", "png", "svg"]
                            ),
                            ashley.validators.validate_upload_image_file_size,
                        ],
                    ),
                ),
                (
                    "forum",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="forum.forum",
                        verbose_name="Forum",
                    ),
                ),
                (
                    "poster",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Poster",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
