# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2019-02-06 11:36
from __future__ import unicode_literals

import uuid

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

# Functions from the following migrations need manual copying.
# Move them and any dependencies into this file, then update the
# RunPython operations to refer to the local versions:
# reference.migrations.0007_populate_uuid_values
# reference.migrations.0012_migrate_fk_to_enum
from reference.migrations.utils.uuid import set_uuid_field


class Migration(migrations.Migration):
    replaces = [('reference', '0001_initial'), ('reference', '0002_auto_20160414_1720'),
                ('reference', '0003_decree_domain'), ('reference', '0004_educationinstitution'),
                ('reference', '0005_auto_20160902_1639'), ('reference', '0006_add_uuid_field'),
                ('reference', '0007_populate_uuid_values'), ('reference', '0008_remove_uuid_null'),
                ('reference', '0009_auto_20160921_1139'), ('reference', '0010_delete_assimilationcriteria'),
                ('reference', '0011_add_field_gtype_to_enum'), ('reference', '0012_migrate_fk_to_enum'),
                ('reference', '0013_auto_20170215_1836'), ('reference', '0014_language_recognized'),
                ('reference', '0015_educationinstitution_address'), ('reference', '0016_auto_20170410_1318'),
                ('reference', '0017_language_changed'), ('reference', '0018_auto_20180727_0947'),
                ('reference', '0019_auto_20180807_1229'), ('reference', '0020_domain_changed'),
                ('reference', '0021_auto_20190128_1631')]

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Continent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=2, unique=True)),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('iso_code', models.CharField(max_length=2, unique=True)),
                ('name', models.CharField(max_length=80, unique=True)),
                ('nationality', models.CharField(blank=True, max_length=80, null=True)),
                ('european_union', models.BooleanField(default=False)),
                ('dialing_code', models.CharField(blank=True, max_length=3, null=True)),
                ('cref_code', models.CharField(blank=True, max_length=3, null=True)),
                ('continent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='reference.Continent')),
            ],
        ),
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=80, unique=True)),
                ('code', models.CharField(blank=True, max_length=4, null=True)),
                ('symbol', models.CharField(blank=True, max_length=6, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=4, unique=True)),
                ('name', models.CharField(max_length=80, unique=True)),
                ('external_id', models.CharField(blank=True, max_length=100, null=True)),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='country',
            name='currency',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE,
                                    to='reference.Currency'),
        ),
        migrations.AddField(
            model_name='country',
            name='external_id',
            field=models.CharField(blank=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='country',
            name='continent',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE,
                                    to='reference.Continent'),
        ),
        migrations.CreateModel(
            name='Decree',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('external_id', models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(max_length=80, unique=True)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Domain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('external_id', models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(max_length=255)),
                ('decree', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE,
                                             to='reference.Decree')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE,
                                             to='reference.Domain')),
                ('adhoc', models.BooleanField(default=True)),
                ('national', models.BooleanField(default=False)),
                ('reference', models.CharField(blank=True, max_length=10, null=True)),
                ('type', models.CharField(
                    choices=[('HIGH_EDUC_NOT_UNIVERSITY', 'HIGH_EDUC_NOT_UNIVERSITY'), ('UNIVERSITY', 'UNIVERSITY'),
                             ('UNKNOWN', 'UNKNOWN')], default='UNKNOWN', max_length=50)),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='GradeType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('external_id', models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(max_length=255)),
                ('coverage', models.CharField(
                    choices=[('HIGH_EDUC_NOT_UNIVERSITY', 'HIGH_EDUC_NOT_UNIVERSITY'), ('UNIVERSITY', 'UNIVERSITY'),
                             ('UNKNOWN', 'UNKNOWN')], default='UNKNOWN', max_length=30)),
                ('adhoc', models.BooleanField(default=True)),
                ('institutional', models.BooleanField(default=False)),
            ],
        ),
        migrations.AddField(
            model_name='country',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, null=True),
        ),
        migrations.AddField(
            model_name='decree',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, null=True),
        ),
        migrations.AddField(
            model_name='gradetype',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, null=True),
        ),
        migrations.RunPython(
            code=set_uuid_field,
        ),
        migrations.AlterField(
            model_name='country',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True),
        ),
        migrations.AlterField(
            model_name='decree',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True),
        ),
        migrations.AlterField(
            model_name='domain',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True),
        ),
        migrations.AlterField(
            model_name='gradetype',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True),
        ),
        migrations.AlterField(
            model_name='language',
            name='uuid',
            field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True),
        ),
        migrations.AddField(
            model_name='gradetype',
            name='institutional_grade_type',
            field=models.CharField(blank=True, choices=[('BACHELOR', 'BACHELOR'), ('MASTER_60', 'MASTER_60'),
                                                        ('MASTER_120', 'MASTER_120'),
                                                        ('MASTER_180_OR_240', 'MASTER_180_OR_240'),
                                                        ('ADVANCED_MASTER', 'ADVANCED_MASTER'),
                                                        ('TRAINING_CERTIFICATE', 'TRAINING_CERTIFICATE'),
                                                        ('CERTIFICATE', 'CERTIFICATE'), ('DOCTORATE', 'DOCTORATE'),
                                                        ('CAPAES', 'CAPAES')], max_length=25, null=True),
        ),
        migrations.AddField(
            model_name='language',
            name='recognized',
            field=models.BooleanField(default=False),
        ),
        migrations.AddField(
            model_name='language',
            name='changed',
            field=models.DateTimeField(auto_now=True, null=True),
        ),
        migrations.RemoveField(
            model_name='domain',
            name='reference',
        ),
        migrations.AddField(
            model_name='domain',
            name='code',
            field=models.CharField(default='', max_length=50),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='country',
            name='external_id',
            field=models.CharField(blank=True, db_index=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='decree',
            name='external_id',
            field=models.CharField(blank=True, db_index=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='domain',
            name='external_id',
            field=models.CharField(blank=True, db_index=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='gradetype',
            name='external_id',
            field=models.CharField(blank=True, db_index=True, max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='language',
            name='external_id',
            field=models.CharField(blank=True, db_index=True, max_length=100, null=True),
        ),
        migrations.AddField(
            model_name='domain',
            name='changed',
            field=models.DateTimeField(auto_now=True, null=True),
        ),
        migrations.AlterModelOptions(
            name='country',
            options={'ordering': ('name',)},
        ),
    ]
