# Generated by Django 5.1.3 on 2024-11-15 07:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('files', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='BaseJob',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='The unique ID (UUID4) of this object.', primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True, help_text='The date and time when this job was first created.')),
                ('updated', models.DateTimeField(auto_now=True, help_text='The date and time when this job was last updated.')),
                ('path', models.CharField(help_text='Path under MEDIA_ROOT for the result of the file processing job.', max_length=255)),
                ('client_uuid', models.UUIDField(blank=True, help_text='The UUID4 of the client instance/thread handling the job.', null=True)),
                ('client_version', models.CharField(blank=True, default='', help_text='Text description of the client handling this job.', max_length=255)),
                ('finished', models.BooleanField(default=False, editable=False, help_text='A job will be marked as finished when the job result has been received.')),
                ('basefile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to='files.basefile')),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='ImageConversionJob',
            fields=[
                ('basejob_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='jobs.basejob')),
                ('width', models.PositiveIntegerField(help_text='The desired width of the converted image.')),
                ('height', models.PositiveIntegerField(help_text='The desired height of the converted image.')),
                ('filetype', models.CharField(help_text='The desired file type for this job.', max_length=10, validators=[jobs.models.validate_image_filetype])),
                ('custom_aspect_ratio', models.BooleanField(default=False, help_text='True if this job needs cropping to a custom AR, False if no crop is needed.')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('jobs.basejob',),
        ),
        migrations.CreateModel(
            name='ImageExifExtractionJob',
            fields=[
                ('basejob_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='jobs.basejob')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('jobs.basejob',),
        ),
        migrations.CreateModel(
            name='ThumbnailSourceJob',
            fields=[
                ('basejob_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='jobs.basejob')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('jobs.basejob',),
        ),
    ]
