# Generated by Django 3.2.7 on 2021-09-22 01:21

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


class Migration(migrations.Migration):

    dependencies = [
        ('gestion', '0001_creacion_tabla_productos'),
    ]

    operations = [
        migrations.CreateModel(
            name='CabeceraModel',
            fields=[
                ('cabeceraId', models.AutoField(db_column='id', primary_key=True, serialize=False, unique=True)),
                ('cabeceraFecha', models.DateTimeField(auto_now_add=True, db_column='fecha')),
                ('cabeceraTipo', models.TextField(choices=[('V', 'VENTA'), ('C', 'COMPRA')], db_column='tipo', default='V')),
            ],
            options={
                'verbose_name': 'cabecera',
                'verbose_name_plural': 'cabeceras',
                'db_table': 'cabecera_operaciones',
            },
        ),
        migrations.CreateModel(
            name='ClienteModel',
            fields=[
                ('clienteId', models.AutoField(db_column='id', primary_key=True, serialize=False, unique=True)),
                ('clienteNombre', models.CharField(db_column='nombre', max_length=45)),
                ('clienteDocumento', models.CharField(db_column='documento', max_length=12, unique=True)),
                ('clienteDireccion', models.CharField(db_column='direccion', max_length=100)),
            ],
            options={
                'verbose_name': 'cliente',
                'verbose_name_plural': 'clientes',
                'db_table': 'cliente',
            },
        ),
        migrations.CreateModel(
            name='DetalleModel',
            fields=[
                ('detalleId', models.AutoField(db_column='id', primary_key=True, serialize=False, unique=True)),
                ('detalleCantidad', models.IntegerField(db_column='cantidad')),
                ('detalleImporte', models.DecimalField(db_column='importe', decimal_places=2, max_digits=5)),
                ('cabeceras', models.ForeignKey(db_column='cabecera_operaciones_id', on_delete=django.db.models.deletion.PROTECT, related_name='cabeceraDetalles', to='gestion.cabeceramodel')),
                ('productos', models.ForeignKey(db_column='productos_id', on_delete=django.db.models.deletion.PROTECT, related_name='productoDetalles', to='gestion.productomodel')),
            ],
            options={
                'verbose_name': 'detalle',
                'verbose_name_plural': 'detalles',
                'db_table': 'detalle_operaciones',
            },
        ),
        migrations.AddField(
            model_name='cabeceramodel',
            name='clientes',
            field=models.ForeignKey(db_column='clientes_id', on_delete=django.db.models.deletion.PROTECT, related_name='clienteCabeceras', to='gestion.clientemodel'),
        ),
    ]
