# Generated by Django 2.1.7 on 2020-07-02 15:28

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('core', '0003_auto_20200702_1228'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Filial',
            fields=[
                ('dat_insercao', models.DateTimeField(auto_now_add=True, null=True)),
                ('dat_edicao', models.DateTimeField(auto_now=True, null=True)),
                ('dat_delete', models.DateTimeField(null=True)),
                ('status', models.BooleanField(default=True, null=True)),
                ('cep', models.CharField(max_length=10, null=True)),
                ('bairro', models.CharField(max_length=100, null=True)),
                ('rua', models.CharField(max_length=100, null=True)),
                ('numero', models.CharField(max_length=30, null=True)),
                ('complemento', models.CharField(max_length=100, null=True)),
                ('ponto_referencia', models.CharField(max_length=100, null=True)),
                ('latitude', models.CharField(max_length=200, null=True)),
                ('longitude', models.CharField(max_length=200, null=True)),
                ('codigo', models.IntegerField(primary_key=True, serialize=False)),
                ('nome', models.CharField(max_length=200, null=True)),
                ('nome_completo', models.CharField(max_length=200, null=True)),
                ('cnpj', models.CharField(max_length=50, null=True)),
                ('telefone', models.CharField(max_length=50, null=True)),
                ('email', models.EmailField(max_length=200, null=True)),
                ('empresa', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Empresa')),
                ('municipio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Municipio')),
            ],
            options={
                'db_table': 'filial',
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='FilialServico',
            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(null=True)),
                ('status', models.BooleanField(default=True, null=True)),
                ('filial', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='filial.Filial')),
            ],
            options={
                'db_table': 'filial_filialservico',
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Servico',
            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(null=True)),
                ('status', models.BooleanField(default=True, null=True)),
                ('nome', models.CharField(max_length=200, null=True)),
                ('descricao', models.TextField(null=True)),
                ('tipo_codigo', models.CharField(max_length=200, null=True)),
                ('tipo_tipo', models.CharField(default='FILIAL.SERVICO.TIPO', max_length=200, null=True)),
                ('tipo', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_servico_tipo', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('tipo_codigo'), 'tipo': compositefk.fields.LocalFieldValue('tipo_tipo')})),
                ('usr_delete', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_servico_usr_delete', to=settings.AUTH_USER_MODEL)),
                ('usr_edicao', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_servico_usr_edicao', to=settings.AUTH_USER_MODEL)),
                ('usr_insercao', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_servico_usr_insercao', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'filial_servico',
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name='filialservico',
            name='servico',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='filial.Servico'),
        ),
        migrations.AddField(
            model_name='filialservico',
            name='usr_delete',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialservico_usr_delete', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='filialservico',
            name='usr_edicao',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialservico_usr_edicao', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='filialservico',
            name='usr_insercao',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialservico_usr_insercao', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='filial',
            name='servicos',
            field=models.ManyToManyField(through='filial.FilialServico', to='filial.Servico'),
        ),
        migrations.AddField(
            model_name='filial',
            name='usr_delete',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filial_usr_delete', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='filial',
            name='usr_edicao',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filial_usr_edicao', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='filial',
            name='usr_insercao',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filial_usr_insercao', to=settings.AUTH_USER_MODEL),
        ),
    ]
