# Generated by Django 3.2.20 on 2024-08-12 19:33

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


class Migration(migrations.Migration):

    replaces = [('djiffy', '0001_initial'), ('djiffy', '0002_view_permissions'), ('djiffy', '0003_extra_data_revisions'), ('djiffy', '0004_migrate_jsonfield')]

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Manifest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.TextField()),
                ('short_id', models.CharField(max_length=255, unique=True)),
                ('uri', models.URLField()),
                ('metadata', models.JSONField(default=dict)),
                ('created', models.DateField(auto_now_add=True)),
                ('last_modified', models.DateField(auto_now=True)),
                ('extra_data', models.JSONField(default=dict)),
            ],
            options={
                'verbose_name': 'IIIF Manifest',
                'permissions': (('view_canvas', 'Can view IIIF Manifest'),),
            },
        ),
        migrations.CreateModel(
            name='Canvas',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.TextField()),
                ('short_id', models.CharField(max_length=255)),
                ('uri', models.URLField()),
                ('iiif_image_id', models.URLField()),
                ('thumbnail', models.BooleanField(default=False)),
                ('order', models.PositiveIntegerField()),
                ('manifest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='canvases', to='djiffy.manifest')),
                ('extra_data', models.JSONField(default=dict)),
            ],
            options={
                'ordering': ['manifest', 'order'],
                'verbose_name': 'IIIF Canvas',
                'verbose_name_plural': 'IIIF Canvases',
                'unique_together': {('short_id', 'manifest')},
                'permissions': (('view_manifest', 'Can view IIIF Canvas'),),
            },
        ),
    ]
