<reponame>kingsdigitallab/ec-django
# Generated by Django 2.2.6 on 2019-10-24 16:35

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('geonames_place', '0004_change_meta_options_on_country'),
    ]

    operations = [
        migrations.CreateModel(
            name='Deed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('n', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('date', models.DateField()),
                ('notes', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='DeedType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Origin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('order', models.PositiveSmallIntegerField(default=0)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OriginType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Profession',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('classmark', models.CharField(max_length=32)),
                ('microfilm', models.CharField(max_length=32)),
            ],
            options={
                'unique_together': {('classmark', 'microfilm')},
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128)),
                ('surname', models.CharField(max_length=128)),
                ('dob', models.DateField(blank=True, null=True)),
                ('origins', models.ManyToManyField(through='deeds.Origin', to='geonames_place.Place')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Party',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('deed', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Deed')),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Person')),
                ('profession', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Profession')),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Role')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='origin',
            name='origin_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.OriginType'),
        ),
        migrations.AddField(
            model_name='origin',
            name='person',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Person'),
        ),
        migrations.AddField(
            model_name='origin',
            name='place',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geonames_place.Place'),
        ),
        migrations.AddField(
            model_name='deed',
            name='deed_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.DeedType'),
        ),
        migrations.AddField(
            model_name='deed',
            name='parties',
            field=models.ManyToManyField(through='deeds.Party', to='deeds.Person'),
        ),
        migrations.AddField(
            model_name='deed',
            name='place',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geonames_place.Place'),
        ),
        migrations.AddField(
            model_name='deed',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Source'),
        ),
        migrations.AlterUniqueTogether(
            name='deed',
            unique_together={('n', 'date')},
        ),
    ]

# Generated by Django 2.2.6 on 2019-10-24 16:35

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('geonames_place', '0004_change_meta_options_on_country'),
    ]

    operations = [
        migrations.CreateModel(
            name='Deed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('n', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('date', models.DateField()),
                ('notes', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='DeedType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Origin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('order', models.PositiveSmallIntegerField(default=0)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OriginType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Profession',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('title', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('classmark', models.CharField(max_length=32)),
                ('microfilm', models.CharField(max_length=32)),
            ],
            options={
                'unique_together': {('classmark', 'microfilm')},
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=128)),
                ('surname', models.CharField(max_length=128)),
                ('dob', models.DateField(blank=True, null=True)),
                ('origins', models.ManyToManyField(through='deeds.Origin', to='geonames_place.Place')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Party',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('deed', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Deed')),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Person')),
                ('profession', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Profession')),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Role')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='origin',
            name='origin_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.OriginType'),
        ),
        migrations.AddField(
            model_name='origin',
            name='person',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Person'),
        ),
        migrations.AddField(
            model_name='origin',
            name='place',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geonames_place.Place'),
        ),
        migrations.AddField(
            model_name='deed',
            name='deed_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.DeedType'),
        ),
        migrations.AddField(
            model_name='deed',
            name='parties',
            field=models.ManyToManyField(through='deeds.Party', to='deeds.Person'),
        ),
        migrations.AddField(
            model_name='deed',
            name='place',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='geonames_place.Place'),
        ),
        migrations.AddField(
            model_name='deed',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='deeds.Source'),
        ),
        migrations.AlterUniqueTogether(
            name='deed',
            unique_together={('n', 'date')},
        ),
    ]
# Generated by Django 2.2.6 on 2019-10-24 16:35