# Generated by Django 3.0.5 on 2020-05-21 19:25

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('collection', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Photograph',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(blank=True, default='', help_text='Short readable label', max_length=400)),
                ('description', models.TextField(blank=True, help_text='Descriptive notes')),
                ('image_path', models.CharField(editable=False, help_text='Base path for the image on the IIIF server', max_length=2000, unique=True)),
                ('original_server_path', models.CharField(editable=False, help_text='The original path and filename from the archives server', max_length=2000, unique=True)),
                ('date_taken_early', models.DateField(db_index=True, help_text='Earliest possible date the original photograph was taken')),
                ('date_taken_late', models.DateField(db_index=True, help_text='Latest possible date the original photograph was taken')),
                ('digitized_date', models.DateTimeField(db_index=True, help_text='Creation date of the original TIF file on the archives server')),
                ('job_sequence', models.PositiveIntegerField(blank=True, help_text='Sequence in the series of photos taken during the job listing', null=True)),
                ('all_directories', models.ManyToManyField(help_text='All ancestor directories. Provided for faster filtering.', related_name='all_photographs', to='collection.Directory')),
                ('directory', models.ForeignKey(help_text='Parent directory', on_delete=django.db.models.deletion.CASCADE, related_name='immediate_photographs', to='collection.Directory')),
                ('job', models.ForeignKey(blank=True, help_text='Official CMU photographer job listing where this photograph was taken', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='photographs', to='collection.Job')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Annotation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True, db_index=True, help_text='Date created (automatically recorded)')),
                ('last_updated', models.DateField(auto_now=True, db_index=True, help_text='Date last modified (automatically recorded)')),
                ('x', models.PositiveIntegerField(help_text='Number of pixels from the left side of the image')),
                ('width', models.PositiveIntegerField(help_text='Width of the region in pixes')),
                ('y', models.PositiveIntegerField(help_text='Number of pixels from the top side of the image')),
                ('height', models.PositiveIntegerField(help_text='Height of the region in pixes')),
                ('photograph', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='annotations', to='photograph.Photograph')),
                ('user_created', models.ForeignKey(editable=False, help_text='Created by user', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='annotations_created', to=settings.AUTH_USER_MODEL)),
                ('user_last_modified', models.ForeignKey(editable=False, help_text='Last modified by user', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='annotations_modified', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
