# Generated by Django 3.2.6 on 2021-08-16 15:13

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='DatasetMetadata',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_identifier', models.TextField(default=uuid.uuid4)),
            ],
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicBaseCheckrun',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('passed', models.BooleanField()),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_polymorphic_fks.djangopolymorphicbasecheckrun_set+', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='FeatureType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='FeatureTypeMetadata',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_identifier', models.TextField(default=uuid.uuid4)),
                ('feature_type', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretype')),
            ],
        ),
        migrations.CreateModel(
            name='Layer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='LayerMetadata',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_identifier', models.TextField(default=uuid.uuid4)),
                ('layer', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layer')),
            ],
        ),
        migrations.CreateModel(
            name='MultiTableBaseCheckrun',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('passed', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='OgcService',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service_type', models.CharField(choices=[('WMS', 'Wms'), ('WFS', 'Wfs'), ('CSW', 'Csw')], max_length=3)),
                ('origin_url', models.URLField(max_length=4096)),
                ('name', models.CharField(max_length=1024)),
            ],
        ),
        migrations.CreateModel(
            name='ServiceMetadata',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_identifier', models.TextField(default=uuid.uuid4)),
                ('service', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice')),
            ],
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dataset_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.datasetmetadata')),
                ('feature_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretype')),
                ('feature_type_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretypemetadata')),
                ('layer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layer')),
                ('layer_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layermetadata')),
                ('ogc_service', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice')),
                ('service_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.servicemetadata')),
            ],
        ),
        migrations.AddField(
            model_name='layer',
            name='service',
            field=models.ForeignKey(help_text='the OGC Service (WMS) this layer belongs to', on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice', verbose_name='parent service'),
        ),
        migrations.AddField(
            model_name='featuretype',
            name='service',
            field=models.ForeignKey(help_text='the OGC Service (WFS) this feature type belongs to', on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice', verbose_name='parent service'),
        ),
        migrations.AddField(
            model_name='datasetmetadata',
            name='feature_types',
            field=models.ManyToManyField(to='polymorphic_fks.FeatureType'),
        ),
        migrations.AddField(
            model_name='datasetmetadata',
            name='layers',
            field=models.ManyToManyField(to='polymorphic_fks.Layer'),
        ),
        migrations.CreateModel(
            name='CheckrunWithMultipleFks',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('passed', models.BooleanField()),
                ('dataset_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.datasetmetadata')),
                ('feature_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretype')),
                ('feature_type_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretypemetadata')),
                ('layer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layer')),
                ('layer_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layermetadata')),
                ('ogc_service', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice')),
                ('service_metadata', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.servicemetadata')),
            ],
        ),
        migrations.CreateModel(
            name='CheckrunWithGenericFk',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('passed', models.BooleanField()),
                ('_resource_id', models.PositiveIntegerField(db_column='resource_id')),
                ('_resource_type', models.ForeignKey(db_column='resource_type_id', limit_choices_to=models.Q(models.Q(('app_label', 'polymorphic_fks'), ('model', 'ogcservice')), models.Q(('app_label', 'polymorphic_fks'), ('model', 'layer')), models.Q(('app_label', 'polymorphic_fks'), ('model', 'featuretype')), models.Q(('app_label', 'polymorphic_fks'), ('model', 'datasetmetadata')), models.Q(('app_label', 'polymorphic_fks'), ('model', 'servicemetadata')), models.Q(('app_label', 'polymorphic_fks'), ('model', 'layermetadata')), models.Q(('app_label', 'polymorphic_fks'), ('model', 'featuretypemetadata')), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
            ],
        ),
        migrations.CreateModel(
            name='CheckrunWithFkLookupTable',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('passed', models.BooleanField()),
                ('_resource', models.ForeignKey(db_column='resource_id', null=True, on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.resource')),
            ],
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunServiceMetadata',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.servicemetadata')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunOgcService',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunLayerMetadata',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layermetadata')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunLayer',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layer')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunFeatureTypeMetadata',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretypemetadata')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunFeatureType',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretype')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='MultiTableCheckrunDatasetMetadata',
            fields=[
                ('multitablebasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.multitablebasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.datasetmetadata')),
            ],
            bases=('polymorphic_fks.multitablebasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunServiceMetadata',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.servicemetadata')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunOgcService',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.ogcservice')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunLayerMetadata',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layermetadata')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunLayer',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.layer')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunFeatureTypeMetadata',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretypemetadata')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunFeatureType',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.featuretype')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
        migrations.CreateModel(
            name='DjangoPolymorphicCheckrunDatasetMetadata',
            fields=[
                ('djangopolymorphicbasecheckrun_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='polymorphic_fks.djangopolymorphicbasecheckrun')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polymorphic_fks.datasetmetadata')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('polymorphic_fks.djangopolymorphicbasecheckrun',),
        ),
    ]
