# Generated by Django 2.0.13 on 2020-06-19 21:41

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('categoria_desc', models.CharField(max_length=30)),
            ],
            options={
                'verbose_name': 'Categoria',
                'permissions': (('view_categoria', 'Can view categoria'),),
            },
        ),
        migrations.CreateModel(
            name='Colaborador',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(blank=True, max_length=100)),
                ('telefone', models.CharField(blank=True, max_length=18)),
                ('cargo', models.CharField(blank=True, max_length=100)),
            ],
            options={
                'verbose_name': 'Colaborador',
                'permissions': (('view_colaborador', 'Can view colaborador'),),
            },
        ),
        migrations.CreateModel(
            name='Departamento',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('departamento_desc', models.CharField(blank=True, max_length=30, unique=True)),
                ('nome_responsavel', models.CharField(blank=True, max_length=100)),
                ('telefone_responsavel', models.CharField(blank=True, max_length=18)),
                ('email_responsavel', models.CharField(max_length=18, null=True)),
            ],
            options={
                'verbose_name': 'Departamento',
                'permissions': (('view_departamento', 'Can view departamento'),),
            },
        ),
        migrations.CreateModel(
            name='Dispositivo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=15, unique=True)),
                ('descricao', models.CharField(max_length=255)),
                ('status', models.CharField(choices=[('ATIVO', 'ATIVO'), ('INATIVO', 'INATIVO'), ('DESCARTE', 'DESCARTE')], default='ATIVO', max_length=8)),
                ('inf_adicionais', models.CharField(blank=True, max_length=255, null=True)),
                ('categoria', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cadastro.Categoria')),
                ('departamento', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Departamento')),
            ],
            options={
                'verbose_name': 'Dispositivo',
                'permissions': (('view_dispositivo', 'Can view dispositivo'),),
            },
        ),
        migrations.CreateModel(
            name='Marca',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('marca_desc', models.CharField(max_length=30)),
            ],
            options={
                'verbose_name': 'Marca',
                'permissions': (('view_marca', 'Can view marca'),),
            },
        ),
        migrations.CreateModel(
            name='Peça',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('codigo', models.CharField(max_length=15, unique=True)),
                ('peça_desc', models.CharField(max_length=255)),
                ('quantidade', models.IntegerField(blank=True, null=True)),
                ('estado', models.CharField(choices=[('NOVA', 'NOVA'), ('USADA', 'USADA'), ('DESCARTE', 'DESCARTE')], max_length=8)),
                ('inf_adicionais', models.CharField(blank=True, max_length=255, null=True)),
                ('categoria', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cadastro.Categoria')),
                ('marca', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cadastro.Marca')),
            ],
            options={
                'verbose_name': 'Peça',
                'permissions': (('view_peça', 'Can view peça'),),
            },
        ),
        migrations.CreateModel(
            name='Servico',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('servico_desc', models.CharField(max_length=30)),
            ],
            options={
                'verbose_name': 'Serviço',
                'permissions': (('view_servico', 'Can view servico'),),
            },
        ),
        migrations.CreateModel(
            name='Tarefa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data_abertura', models.DateTimeField(auto_now_add=True)),
                ('status_servico', models.CharField(blank=True, choices=[('Pendente', 'Pendente'), ('Na bancada', 'Na bancada'), ('Finalizada', 'Finalizada')], max_length=50)),
                ('defeito', models.CharField(blank=True, max_length=50)),
                ('inf_adicionais', models.CharField(blank=True, max_length=255, null=True)),
                ('colaborador', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Colaborador')),
                ('dispositivo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Dispositivo')),
                ('servico', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Servico')),
            ],
            options={
                'verbose_name': 'Tarefa',
                'permissions': (('view_tarefa', 'Can view tarefa'),),
            },
        ),
        migrations.CreateModel(
            name='TrocaPecas',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('data_troca', models.DateTimeField(auto_now_add=True)),
                ('status_servico', models.CharField(blank=True, choices=[('Pendente', 'Pendente'), ('Na bancada', 'Na bancada'), ('Finalizada', 'Finalizada')], max_length=50)),
                ('motivo_troca', models.CharField(blank=True, max_length=100)),
                ('inf_adicionais', models.CharField(blank=True, max_length=255, null=True)),
                ('colaborador', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Colaborador')),
                ('dispositivo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Dispositivo')),
                ('peca', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='cadastro.Peça')),
            ],
            options={
                'verbose_name': 'TrocaPecas',
                'permissions': (('view_trocaPeca', 'Can view trocaPeca'),),
            },
        ),
        migrations.CreateModel(
            name='Unidade',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sigla_unidade', models.CharField(max_length=3)),
                ('unidade_desc', models.CharField(max_length=16)),
            ],
            options={
                'verbose_name': 'Unidade',
                'permissions': (('view_unidade', 'Can view unidade'),),
            },
        ),
        migrations.AddField(
            model_name='peça',
            name='unidade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cadastro.Unidade'),
        ),
        migrations.AddField(
            model_name='dispositivo',
            name='marca',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cadastro.Marca'),
        ),
        migrations.AddField(
            model_name='dispositivo',
            name='unidade',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='cadastro.Unidade'),
        ),
    ]
