# 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='Grupo',
            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)),
                ('nivel', models.IntegerField(null=True)),
                ('nome', models.CharField(max_length=200, primary_key=True, serialize=False)),
                ('nm_descritivo', models.CharField(max_length=200, null=True)),
                ('descricao', models.CharField(max_length=500, null=True)),
                ('grupo_pai', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='usr_grupo_grupo_pai', to='usr.Grupo')),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='usr_grupo_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='usr_grupo_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='usr_grupo_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')})),
            ],
            options={
                'db_table': 'usr_grupo',
                'abstract': False,
                'managed': True,
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='GrupoUser',
            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)),
                ('usr_id', models.IntegerField(null=True)),
                ('usr_codigo', models.CharField(max_length=200, null=True)),
                ('usr_tipo', models.CharField(default='USR.ORIGEM', max_length=200, null=True)),
                ('grupo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='usr.Grupo')),
                ('origem_delete', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='usr_grupouser_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='usr_grupouser_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='usr_grupouser_origem_insercao', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('origem_insercao_codigo'), 'tipo': compositefk.fields.LocalFieldValue('origem_insercao_tipo')})),
                ('usr', compositefk.fields.CompositeForeignKey(null=True, null_if_equal=[], on_delete=django.db.models.deletion.DO_NOTHING, related_name='usr_grupouser_usr', to='core.Tipo', to_fields={'codigo': compositefk.fields.LocalFieldValue('usr_codigo'), 'tipo': compositefk.fields.LocalFieldValue('usr_tipo')})),
            ],
            options={
                'db_table': 'usr_grupouser',
                'abstract': False,
                'managed': True,
            },
            managers=[
                ('normal_objects', django.db.models.manager.Manager()),
            ],
        ),
    ]
