# Generated by Django 2.1.7 on 2020-07-10 18:20

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('core', '0001_initial'),
    ]

    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)),
                ('usr_insercao', models.IntegerField(null=True)),
                ('usr_edicao', models.IntegerField(null=True)),
                ('usr_delete', models.IntegerField(null=True)),
                ('origem_insercao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_insercao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_edicao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_edicao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_delete_codigo', models.CharField(max_length=200, null=True)),
                ('origem_delete_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('status', models.BooleanField(default=True, 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)),
                ('cep', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Cep')),
                ('empresa', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Empresa')),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filial_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_filial_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_filial_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')})),
            ],
            options={
                'db_table': 'filial',
                'abstract': False,
                'managed': True,
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='FilialHoraFuncionamento',
            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)),
                ('usr_insercao', models.IntegerField(null=True)),
                ('usr_edicao', models.IntegerField(null=True)),
                ('usr_delete', models.IntegerField(null=True)),
                ('origem_insercao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_insercao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_edicao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_edicao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_delete_codigo', models.CharField(max_length=200, null=True)),
                ('origem_delete_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('status', models.BooleanField(default=True, null=True)),
                ('is_padrao', models.BooleanField(default=True, null=True)),
                ('dat_ini_validade', models.DateField(null=True)),
                ('dat_fim_validade', models.DateTimeField(null=True)),
                ('cd_filial', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='filial.Filial')),
                ('cd_hr_dom_fim', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cd_hr_dom_fim', to='core.Hora')),
                ('cd_hr_dom_inicio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cd_hr_dom_inicio', to='core.Hora')),
                ('cd_hr_sab_fim', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cd_hr_sab_fim', to='core.Hora')),
                ('cd_hr_sab_inicio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cd_hr_sab_inicio', to='core.Hora')),
                ('cd_hr_util_fim', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cd_hr_util_fim', to='core.Hora')),
                ('cd_hr_util_inicio', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='cd_hr_util_inicio', to='core.Hora')),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialhorafuncionamento_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_filialhorafuncionamento_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_filialhorafuncionamento_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')})),
            ],
            options={
                'db_table': 'filial_horafuncionamento',
                'abstract': False,
                'managed': True,
            },
            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)),
                ('usr_insercao', models.IntegerField(null=True)),
                ('usr_edicao', models.IntegerField(null=True)),
                ('usr_delete', models.IntegerField(null=True)),
                ('origem_insercao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_insercao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_edicao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_edicao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_delete_codigo', models.CharField(max_length=200, null=True)),
                ('origem_delete_tipo', models.CharField(default='USR.ORIGEM', max_length=200, 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')),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_filialservico_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_filialservico_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_filialservico_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')})),
            ],
            options={
                'db_table': 'filial_filialservico',
                'abstract': False,
                'managed': True,
            },
            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)),
                ('usr_insercao', models.IntegerField(null=True)),
                ('usr_edicao', models.IntegerField(null=True)),
                ('usr_delete', models.IntegerField(null=True)),
                ('origem_insercao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_insercao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_edicao_codigo', models.CharField(max_length=200, null=True)),
                ('origem_edicao_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('origem_delete_codigo', models.CharField(max_length=200, null=True)),
                ('origem_delete_tipo', models.CharField(default='USR.ORIGEM', max_length=200, 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)),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='filial_servico_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_servico_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_servico_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_servico_tipo', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('tipo_codigo'), 'tipo': compositefk.fields.LocalFieldValue('tipo_tipo')})),
            ],
            options={
                'db_table': 'filial_servico',
                'abstract': False,
                'managed': True,
            },
            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='filial',
            name='servicos',
            field=models.ManyToManyField(through='filial.FilialServico', to='filial.Servico'),
        ),
    ]
