# Generated by Django 3.1.7 on 2021-04-14 17:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CurriculumVitae',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('residence_address', models.CharField(max_length=255)),
                ('residence_department', models.CharField(max_length=50)),
                ('residence_province', models.CharField(max_length=50)),
                ('residence_district', models.CharField(max_length=50)),
                ('residence_ubigeo', models.CharField(max_length=6)),
                ('birth_country', models.CharField(max_length=100)),
                ('birth_department', models.CharField(max_length=50)),
                ('birth_province', models.CharField(max_length=50)),
                ('birth_district', models.CharField(max_length=50)),
                ('birth_ubigeo', models.CharField(max_length=6)),
                ('primary_school', models.BooleanField()),
                ('concluded_primary_school', models.BooleanField()),
                ('high_school', models.BooleanField()),
                ('concluded_high_school', models.BooleanField()),
                ('has_technical_education', models.BooleanField(blank=True, null=True)),
                ('has_non_university_education', models.BooleanField(blank=True, null=True)),
                ('additional_information', models.TextField()),
                ('incomes_year', models.PositiveIntegerField(blank=0, null=True)),
                ('gross_annual_remunerations_public', models.PositiveBigIntegerField(blank=0, null=True)),
                ('gross_annual_remunerations_private', models.PositiveBigIntegerField(blank=0, null=True)),
                ('gross_annual_income_per_individual_year_public', models.PositiveBigIntegerField(blank=0, null=True)),
                ('gross_annual_income_per_individual_year_private', models.PositiveBigIntegerField(blank=0, null=True)),
                ('other_income_public', models.PositiveBigIntegerField(blank=0, null=True)),
                ('other_income_private', models.PositiveBigIntegerField(blank=0, null=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('total_incomes', models.PositiveBigIntegerField()),
                ('total_movable_properties_value', models.PositiveBigIntegerField(default=0)),
                ('total_immovable_properties_value', models.PositiveBigIntegerField(default=0)),
                ('total_movable_immovable_properties_value', models.PositiveBigIntegerField()),
                ('total_penal_sentences', models.PositiveIntegerField(default=0)),
                ('total_obligation_sentences', models.PositiveIntegerField(default=0)),
                ('total_sentences', models.PositiveIntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='ElectionProcess',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('call_date', models.DateField(null=True)),
                ('registration_date', models.DateField(null=True)),
                ('opening_date', models.DateField(null=True)),
                ('closing_date', models.DateField(null=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
            ],
            options={
                'verbose_name': 'Election Process',
                'verbose_name_plural': 'Election Processes',
            },
        ),
        migrations.CreateModel(
            name='ElectionType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('jne_id', models.BigIntegerField(unique=True)),
            ],
            options={
                'verbose_name': 'Election Type',
                'verbose_name_plural': 'Election Types',
            },
        ),
        migrations.CreateModel(
            name='ElectoralDistrict',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('ubigeo', models.CharField(max_length=6, unique=True)),
            ],
            options={
                'verbose_name': 'Electoral District',
                'verbose_name_plural': 'Electoral Districts',
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=50)),
                ('surname', models.CharField(max_length=50)),
                ('second_surname', models.CharField(max_length=50)),
                ('birth_date', models.DateField(blank=True, null=True)),
                ('birth_address', models.CharField(max_length=255)),
                ('birth_country', models.CharField(max_length=50)),
                ('birth_department', models.CharField(max_length=50)),
                ('birth_province', models.CharField(max_length=50)),
                ('birth_district', models.CharField(max_length=50)),
                ('birth_ubigeo', models.CharField(max_length=6)),
                ('dni', models.CharField(db_index=True, max_length=20)),
                ('gender', models.CharField(blank=True, choices=[('', ''), ('M', 'Male'), ('F', 'Female')], max_length=1)),
            ],
        ),
        migrations.CreateModel(
            name='PoliticalOrganization',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('jne_id', models.BigIntegerField(unique=True)),
            ],
            options={
                'verbose_name': 'Political Organization',
                'verbose_name_plural': 'Political Organizations',
            },
        ),
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('jne_id', models.BigIntegerField(unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='UniversityEducation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('university', models.CharField(max_length=200)),
                ('degree', models.CharField(max_length=150)),
                ('year', models.PositiveIntegerField(blank=True, null=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='university_educations', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.CreateModel(
            name='RelElectionProcessElectionType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('election_process', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.electionprocess')),
                ('election_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.electiontype')),
                ('political_organizations', models.ManyToManyField(to='app_elections.PoliticalOrganization')),
            ],
            options={
                'unique_together': {('election_process', 'election_type')},
            },
        ),
        migrations.CreateModel(
            name='ProfessionalExperience',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('workplace', models.CharField(max_length=200)),
                ('position', models.CharField(max_length=200)),
                ('starting_year', models.PositiveIntegerField()),
                ('ending_year', models.PositiveIntegerField(blank=True, null=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='professional_experiences', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.CreateModel(
            name='PostgraduateEducation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study_center', models.CharField(max_length=200)),
                ('specialty', models.CharField(max_length=200)),
                ('year', models.PositiveIntegerField(blank=True, null=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='postgraduate_educations', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.CreateModel(
            name='PenalSentence',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file_number', models.CharField(max_length=40)),
                ('criminal_sentence_date', models.DateField()),
                ('judicial_authority', models.CharField(max_length=100)),
                ('criminal_offense', models.CharField(max_length=100)),
                ('judgment', models.CharField(max_length=255)),
                ('modality', models.CharField(max_length=50)),
                ('other_modality', models.CharField(max_length=100)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='penal_sentences', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.CreateModel(
            name='PartisanPosition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('starting_year', models.PositiveIntegerField()),
                ('ending_year', models.PositiveIntegerField(blank=True, null=True)),
                ('position', models.CharField(max_length=100)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='partisan_positions', to='app_elections.curriculumvitae')),
                ('political_organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.politicalorganization')),
            ],
        ),
        migrations.CreateModel(
            name='ObligationSentence',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('demand_matter', models.CharField(max_length=50)),
                ('file_number', models.CharField(max_length=40)),
                ('judicial_authority', models.CharField(max_length=100)),
                ('judgment', models.TextField()),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='obligation_sentences', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.CreateModel(
            name='MovableProperty',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('property_type', models.CharField(max_length=100)),
                ('features', models.CharField(blank=True, max_length=255)),
                ('value', models.BigIntegerField()),
                ('comment', models.TextField(blank=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='movable_properties', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.CreateModel(
            name='ImmovableProperty',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('property_type', models.CharField(max_length=100)),
                ('value', models.BigIntegerField()),
                ('comment', models.TextField(blank=True)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='immovable_properties', to='app_elections.curriculumvitae')),
            ],
        ),
        migrations.AddField(
            model_name='electionprocess',
            name='districts',
            field=models.ManyToManyField(to='app_elections.ElectoralDistrict'),
        ),
        migrations.AddField(
            model_name='electionprocess',
            name='election_types',
            field=models.ManyToManyField(through='app_elections.RelElectionProcessElectionType', to='app_elections.ElectionType'),
        ),
        migrations.AddField(
            model_name='electionprocess',
            name='positions',
            field=models.ManyToManyField(to='app_elections.Position'),
        ),
        migrations.CreateModel(
            name='Candidate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ballot_position', models.PositiveSmallIntegerField()),
                ('full_name', models.CharField(max_length=200)),
                ('status_on_list', models.CharField(db_index=True, max_length=20)),
                ('jne_id', models.BigIntegerField(unique=True)),
                ('cv_jne_id', models.BigIntegerField(db_index=True, null=True)),
                ('photo_url_path', models.CharField(max_length=255)),
                ('cv', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app_elections.curriculumvitae')),
                ('election', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='candidates', to='app_elections.electionprocess')),
                ('election_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.electiontype')),
                ('electoral_district', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app_elections.electoraldistrict')),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.person')),
                ('political_organization', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.politicalorganization')),
                ('position', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_elections.position')),
            ],
        ),
    ]
