# Generated by Django 2.2 on 2019-04-26 01:35

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Acao',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_acao', models.CharField(max_length=500)),
            ],
            options={
                'verbose_name_plural': 'Ações',
            },
        ),
        migrations.CreateModel(
            name='Alocacao',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantidade_referencia', models.IntegerField(blank=True)),
                ('capacidade_caixa', models.IntegerField(blank=True)),
                ('quantidade_caixas', models.IntegerField(blank=True)),
                ('pdf', models.FileField(blank=True, upload_to='pdf/')),
            ],
            options={
                'verbose_name_plural': 'Alocacoes',
            },
        ),
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_cliente', models.CharField(max_length=500)),
                ('cnpj', models.CharField(max_length=14)),
                ('telefone', models.CharField(max_length=15)),
                ('email', models.CharField(max_length=500)),
                ('data_criacao', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name_plural': 'Clientes',
            },
        ),
        migrations.CreateModel(
            name='Funcionario',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_funcionario', models.CharField(max_length=500)),
            ],
            options={
                'verbose_name_plural': 'Funcionarios',
            },
        ),
        migrations.CreateModel(
            name='Maquina',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_maquina', models.CharField(max_length=500)),
            ],
        ),
        migrations.CreateModel(
            name='Pedido',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('op', models.CharField(blank=True, max_length=5000)),
                ('data_criacao', models.DateTimeField(auto_now_add=True)),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Cliente')),
            ],
            options={
                'verbose_name_plural': 'Pedidos',
            },
        ),
        migrations.CreateModel(
            name='Sequencia',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_sequencia', models.CharField(max_length=500)),
            ],
            options={
                'verbose_name_plural': 'Sequencias',
            },
        ),
        migrations.CreateModel(
            name='Pistola',
            fields=[
                ('funcionario', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='core.Funcionario')),
                ('nome_pistola', models.CharField(max_length=500)),
            ],
            options={
                'verbose_name_plural': 'Pistolas',
            },
        ),
        migrations.CreateModel(
            name='SequenciaAcao',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ordem_execucao', models.CharField(max_length=500)),
                ('tempo_meta', models.CharField(max_length=500)),
                ('acao', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Acao')),
                ('sequencia', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Sequencia')),
            ],
            options={
                'verbose_name_plural': 'Sequencias e Ações',
            },
        ),
        migrations.CreateModel(
            name='Referencia',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_referencia', models.CharField(max_length=500)),
                ('cliente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Cliente')),
            ],
            options={
                'verbose_name_plural': 'Referencias',
            },
        ),
        migrations.CreateModel(
            name='PedidoSKU',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantidade', models.IntegerField()),
                ('data_criacao', models.DateTimeField(auto_now_add=True)),
                ('pedido', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Pedido')),
                ('referencia', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Referencia')),
            ],
            options={
                'verbose_name_plural': 'Pedido_SKUs',
            },
        ),
        migrations.CreateModel(
            name='Caixa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pdf', models.FileField(blank=True, upload_to='pdf/')),
                ('alocacao', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Alocacao')),
            ],
            options={
                'verbose_name_plural': 'Caixas',
            },
        ),
        migrations.CreateModel(
            name='BackLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pedido_data_criacao', models.DateTimeField(auto_now_add=True)),
                ('pedido_op', models.TextField(blank=True)),
                ('nome_cliente', models.TextField(blank=True)),
                ('nome_referencia', models.TextField(blank=True)),
                ('nome_acao', models.TextField(blank=True)),
                ('ordem_execucao', models.IntegerField(null=True)),
                ('alocacao', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Alocacao')),
                ('caixa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Caixa')),
                ('cliente', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Cliente')),
                ('pedido', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Pedido')),
                ('referencia', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Referencia')),
                ('sequencia_acao', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.SequenciaAcao')),
            ],
            options={
                'verbose_name_plural': 'BackLogs',
            },
        ),
        migrations.AddField(
            model_name='alocacao',
            name='pedido',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Pedido'),
        ),
        migrations.AddField(
            model_name='alocacao',
            name='referencia',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Referencia'),
        ),
        migrations.AddField(
            model_name='alocacao',
            name='sequencia',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Sequencia'),
        ),
        migrations.AddField(
            model_name='acao',
            name='maquina',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Maquina'),
        ),
        migrations.CreateModel(
            name='LogTrabalho',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('id_leitura', models.IntegerField()),
                ('cod_barras', models.CharField(max_length=500)),
                ('data_criacao', models.DateTimeField(auto_now_add=True)),
                ('funcionario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Funcionario')),
                ('pistola', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Pistola')),
            ],
            options={
                'verbose_name_plural': 'Log_Trabalhos',
            },
        ),
    ]
