# Generated by Django 2.1.7 on 2020-08-18 21:26

import compositefk.fields
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0017_auto_20200806_1830'),
        ('filial', '0018_auto_20200806_1830'),
    ]

    operations = [
        migrations.CreateModel(
            name='Area',
            fields=[
                ('dat_insercao', models.DateTimeField(auto_now_add=True, null=True)),
                ('dat_edicao', models.DateTimeField(auto_now=True, null=True)),
                ('dat_delete', models.DateTimeField(blank=True, null=True)),
                ('usr_insercao', models.IntegerField(blank=True, null=True)),
                ('usr_edicao', models.IntegerField(blank=True, null=True)),
                ('usr_delete', models.IntegerField(blank=True, null=True)),
                ('origem_insercao_codigo', models.CharField(blank=True, max_length=200, null=True)),
                ('origem_insercao_tipo', models.CharField(blank=True, default='USR.PROFILE', max_length=200, null=True)),
                ('origem_edicao_codigo', models.CharField(blank=True, max_length=200, null=True)),
                ('origem_edicao_tipo', models.CharField(blank=True, default='USR.PROFILE', max_length=200, null=True)),
                ('origem_delete_codigo', models.CharField(blank=True, max_length=200, null=True)),
                ('origem_delete_tipo', models.CharField(blank=True, default='USR.PROFILE', max_length=200, null=True)),
                ('status', models.BooleanField(default=True, null=True)),
                ('cd_area', models.IntegerField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=200, null=True)),
                ('nome_completo', models.CharField(max_length=200, null=True)),
                ('tipo_codigo', models.CharField(max_length=200, null=True)),
                ('tipo_tipo', models.CharField(default='FILIAL.AREA', max_length=200, null=True)),
                ('area_pai', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='filial.Area')),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_area_origem_delete', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_delete_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_delete_tipo')})),
                ('origem_edicao', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_area_origem_edicao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_edicao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_edicao_tipo')})),
                ('origem_insercao', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_area_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')})),
                ('tipo', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_area', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('tipo_codigo'), 'tipo': compositefk.fields.LocalFieldValue('tipo_tipo')})),
            ],
            options={
                'db_table': 'filial_area',
                'abstract': False,
                'managed': True,
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='FilialArea',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dat_insercao', models.DateTimeField(auto_now_add=True, null=True)),
                ('dat_edicao', models.DateTimeField(auto_now=True, null=True)),
                ('dat_delete', models.DateTimeField(blank=True, null=True)),
                ('usr_insercao', models.IntegerField(blank=True, null=True)),
                ('usr_edicao', models.IntegerField(blank=True, null=True)),
                ('usr_delete', models.IntegerField(blank=True, null=True)),
                ('origem_insercao_codigo', models.CharField(blank=True, max_length=200, null=True)),
                ('origem_insercao_tipo', models.CharField(blank=True, default='USR.PROFILE', max_length=200, null=True)),
                ('origem_edicao_codigo', models.CharField(blank=True, max_length=200, null=True)),
                ('origem_edicao_tipo', models.CharField(blank=True, default='USR.PROFILE', max_length=200, null=True)),
                ('origem_delete_codigo', models.CharField(blank=True, max_length=200, null=True)),
                ('origem_delete_tipo', models.CharField(blank=True, default='USR.PROFILE', max_length=200, null=True)),
                ('status', models.BooleanField(default=True, null=True)),
                ('dat_ini', models.DateField(null=True)),
                ('dat_fim', models.DateField(null=True)),
                ('area', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='filial.Area')),
            ],
            options={
                'db_table': 'filial_filialarea',
                'abstract': False,
                'managed': True,
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.RemoveField(
            model_name='filial',
            name='telefone',
        ),
        migrations.AddField(
            model_name='filial',
            name='celular_completo',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='celular_completo_form',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='celular_ddd',
            field=models.CharField(max_length=3, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='celular_numero',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='dat_abertura',
            field=models.DateField(null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='dat_fechamento',
            field=models.DateField(null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='ip_acesso',
            field=models.CharField(max_length=100, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='is_loja',
            field=models.BooleanField(default=True, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='telefone_completo',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='telefone_completo_form',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='telefone_ddd',
            field=models.CharField(max_length=3, null=True),
        ),
        migrations.AddField(
            model_name='filial',
            name='telefone_numero',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='filialservico',
            name='informacao',
            field=models.CharField(max_length=500, null=True),
        ),
        migrations.AddField(
            model_name='filialarea',
            name='cd_filial',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='filial.Filial'),
        ),
        migrations.AddField(
            model_name='filialarea',
            name='origem_delete',
            field=compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialarea_origem_delete', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_delete_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_delete_tipo')}),
        ),
        migrations.AddField(
            model_name='filialarea',
            name='origem_edicao',
            field=compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialarea_origem_edicao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_edicao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_edicao_tipo')}),
        ),
        migrations.AddField(
            model_name='filialarea',
            name='origem_insercao',
            field=compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialarea_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')}),
        ),
        migrations.AddField(
            model_name='filial',
            name='area',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='area_atual', to='filial.Area'),
        ),
        migrations.AddField(
            model_name='filial',
            name='areas',
            field=models.ManyToManyField(through='filial.FilialArea', to='filial.Area'),
        ),
    ]
