# Generated by Django 2.2.6 on 2019-10-04 23:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Departamento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=40, verbose_name='Nome do Departamento')),
                ('funcao', models.CharField(max_length=50, verbose_name='Função')),
            ],
        ),
        migrations.CreateModel(
            name='Documento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('numero', models.IntegerField(verbose_name='Número')),
                ('titulo', models.CharField(max_length=100)),
                ('data_criacao', models.DateField(auto_now_add=True)),
                ('texto', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Pessoa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=30, verbose_name='Nome')),
                ('data_de_nascimento', models.DateField(blank=True, null=True, verbose_name='Data de nascimento')),
                ('cpf', models.IntegerField(verbose_name='CPF')),
            ],
        ),
        migrations.CreateModel(
            name='Processo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('numero', models.IntegerField(verbose_name='Número')),
                ('data_criacao', models.DateField(auto_now_add=True)),
                ('interessados', models.ManyToManyField(related_name='interessados_processo_set', to='app_processo.Pessoa')),
                ('investigados', models.ManyToManyField(related_name='investigados_processo_set', to='app_processo.Pessoa')),
                ('local', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app_processo.Departamento')),
            ],
        ),
        migrations.CreateModel(
            name='Funcionario',
            fields=[
                ('pessoa_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app_processo.Pessoa')),
                ('matricula', models.IntegerField(verbose_name='Matrícula')),
            ],
            bases=('app_processo.pessoa',),
        ),
        migrations.CreateModel(
            name='PedidoDePrazo',
            fields=[
                ('documento_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app_processo.Documento')),
                ('justificativa', models.TextField()),
                ('data_prazo_anterior', models.DateField()),
                ('data_prazo_novo', models.DateField()),
            ],
            bases=('app_processo.documento',),
        ),
        migrations.CreateModel(
            name='Portaria',
            fields=[
                ('documento_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app_processo.Documento')),
                ('justificativa', models.TextField()),
                ('data_prazo', models.DateField()),
            ],
            bases=('app_processo.documento',),
        ),
        migrations.CreateModel(
            name='Tramitacao',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data_origem', models.DateField()),
                ('data_movimentacao', models.DateField()),
                ('departamento_anterior', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='departamentoanterior_tramitacao_set', to='app_processo.Departamento')),
                ('departamento_novo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='departamentonovo_tramitacao_set', to='app_processo.Departamento')),
                ('processo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app_processo.Processo')),
            ],
        ),
        migrations.AddField(
            model_name='documento',
            name='processo',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app_processo.Processo'),
        ),
        migrations.AddField(
            model_name='processo',
            name='funcionario',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app_processo.Funcionario', verbose_name='Funcionário'),
        ),
        migrations.CreateModel(
            name='EnvioDeProcesso',
            fields=[
                ('documento_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app_processo.Documento')),
                ('data_envio', models.DateField()),
                ('departamento_envio', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='departamentonovo_enviodeprocesso_set', to='app_processo.Departamento')),
            ],
            bases=('app_processo.documento',),
        ),
        migrations.AddField(
            model_name='documento',
            name='usuario',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app_processo.Funcionario', verbose_name='Funcionário'),
        ),
    ]
