# Generated by Django 3.1.2 on 2020-10-20 16:04

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Batch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=50, unique=True)),
                ('producer', models.CharField(max_length=20)),
                ('produce_date', models.DateField()),
                ('shelf_life', models.DateField()),
                ('size', models.CharField(choices=[('P', 'Pequeno'), ('M', 'Médio'), ('G', 'Grande')], default='M', max_length=1)),
            ],
            options={
                'db_table': 'batch',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=30, unique=True)),
                ('descricao', models.CharField(max_length=254)),
                ('preco', models.DecimalField(decimal_places=2, max_digits=15)),
                ('batch', models.ForeignKey(db_column='batch_id', on_delete=django.db.models.deletion.PROTECT, to='product.batch')),
            ],
            options={
                'db_table': 'product',
            },
        ),
    ]
