# Generated by Django 3.2.11 on 2022-04-23 14:55

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


class Migration(migrations.Migration):

    dependencies = [
        ('datacite', '0004_add_funding_reference'),
    ]

    operations = [
        migrations.AlterField(
            model_name='creator',
            name='name',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datacite.name'),
        ),
        migrations.AlterField(
            model_name='name',
            name='affiliations',
            field=models.ManyToManyField(blank=True, related_name='as_affiliation', to='datacite.Name'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='alternate_identifiers',
            field=models.ManyToManyField(blank=True, related_name='as_alternate_identifier', through='datacite.AlternateIdentifier', to='datacite.Identifier'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='contributors',
            field=models.ManyToManyField(blank=True, related_name='as_contributor', through='datacite.Contributor', to='datacite.Name'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='creators',
            field=models.ManyToManyField(blank=True, related_name='as_creator', through='datacite.Creator', to='datacite.Name'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='funding_references',
            field=models.ManyToManyField(blank=True, related_name='as_funder', through='datacite.FundingReference', to='datacite.Name'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='geo_locations',
            field=models.ManyToManyField(blank=True, related_name='resources', to='datacite.GeoLocation'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='identifier',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='as_identifier', to='datacite.identifier'),
        ),
        migrations.AlterField(
            model_name='resource',
            name='related_identifiers',
            field=models.ManyToManyField(blank=True, related_name='as_related_identifier', through='datacite.RelatedIdentifier', to='datacite.Identifier'),
        ),
        migrations.CreateModel(
            name='RelatedItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('relation_type', models.CharField(blank=True, max_length=32)),
                ('volume', models.CharField(blank=True, max_length=256)),
                ('issue', models.CharField(blank=True, max_length=256)),
                ('number', models.CharField(blank=True, max_length=256)),
                ('number_type', models.CharField(blank=True, max_length=32)),
                ('first_page', models.CharField(blank=True, max_length=256)),
                ('last_page', models.CharField(blank=True, max_length=256)),
                ('edition', models.CharField(blank=True, max_length=256)),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='datacite.resource')),
                ('resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='datacite.resource')),
            ],
        ),
        migrations.AddField(
            model_name='resource',
            name='related_items',
            field=models.ManyToManyField(blank=True, related_name='as_related_item', through='datacite.RelatedItem', to='datacite.Resource'),
        ),
    ]
