# Generated by Django 3.2.11 on 2022-04-22 16:23

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_datacite.validators


class Migration(migrations.Migration):

    dependencies = [
        ('datacite', '0002_alter_resource_identifier'),
    ]

    operations = [
        migrations.CreateModel(
            name='GeoLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geo_location_place', models.TextField(blank=True)),
            ],
        ),
        migrations.AlterField(
            model_name='resource',
            name='identifier',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='resources_as_identifier', to='datacite.identifier'),
        ),
        migrations.CreateModel(
            name='GeoLocationPolygon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('polygon_points', models.JSONField(default=list, validators=[django_datacite.validators.validate_polygon_points])),
                ('in_point_longitude', models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
                ('in_point_latitude', models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)])),
                ('geo_location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='geo_location_polygons', to='datacite.geolocation')),
            ],
        ),
        migrations.CreateModel(
            name='GeoLocationPoint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('point_longitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
                ('point_latitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)])),
                ('geo_location', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='geo_location_point', to='datacite.geolocation')),
            ],
        ),
        migrations.CreateModel(
            name='GeoLocationBox',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('west_bound_longitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
                ('east_bound_longitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-180), django.core.validators.MaxValueValidator(180)])),
                ('south_bound_latitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)])),
                ('north_bound_latitude', models.FloatField(validators=[django.core.validators.MinValueValidator(-90), django.core.validators.MaxValueValidator(90)])),
                ('geo_location', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='geo_location_box', to='datacite.geolocation')),
            ],
        ),
        migrations.AddField(
            model_name='resource',
            name='geo_locations',
            field=models.ManyToManyField(blank=True, related_name='geo_locations', to='datacite.GeoLocation'),
        ),
    ]
