# Generated by Django 3.1.4 on 2021-01-13 20:21

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


class Migration(migrations.Migration):

    dependencies = [
        ("files", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="tfile",
            name="mime_type",
            field=models.CharField(default="", max_length=32),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name="TFormattedImage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("file", models.FileField(upload_to=files.upload.format_upload_to)),
                ("filename", models.CharField(max_length=128)),
                ("mime_type", models.CharField(max_length=32)),
                ("width", models.IntegerField()),
                ("height", models.IntegerField()),
                (
                    "t_file",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ref_t_formatted_image",
                        to="files.tfile",
                    ),
                ),
            ],
            options={
                "verbose_name": "Formatted Image",
                "db_table": "t_formatted_image",
                "unique_together": {("t_file", "mime_type")},
            },
        ),
    ]
