# Generated by Django 3.0.7 on 2020-07-11 15:19

from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import multiselectfield.db.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('cliente_id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=40)),
                ('apellido', models.CharField(max_length=40)),
                ('cedula', models.PositiveIntegerField(blank=True, default='1', null=True)),
                ('correo', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Entrada',
            fields=[
                ('num_entrada', models.AutoField(primary_key=True, serialize=False)),
                ('precio', models.PositiveIntegerField(default=0, null=True)),
                ('cliente_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Cliente')),
            ],
        ),
        migrations.CreateModel(
            name='Factura',
            fields=[
                ('num_factura', models.AutoField(primary_key=True, serialize=False)),
                ('fecha', models.DateTimeField()),
                ('met_pago', models.CharField(choices=[('EF', 'Efectivo'), ('DE', 'Debito'), ('CR', 'Credito')], default='Efectivo', max_length=2)),
                ('cliente_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Cliente')),
            ],
        ),
        migrations.CreateModel(
            name='Pelicula',
            fields=[
                ('pelicula_id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=50, null=True)),
                ('sinopsis', models.TextField(max_length=100)),
                ('fecha_estreno', models.DateField()),
                ('estatus', models.CharField(choices=[('PE', 'Por Estrenar'), ('EC', 'En Cartelera'), ('AR', 'Archivada')], max_length=2, null=True)),
                ('genero', multiselectfield.db.fields.MultiSelectField(choices=[('AC', 'Accion'), ('AV', 'Aventura'), ('AN', 'Animacion'), ('CO', 'Comedia'), ('DR', 'Drama'), ('DO', 'Documental'), ('HO', 'Horror'), ('SU', 'Suspenso'), ('AN', 'Animacion')], max_length=26, null=True)),
                ('duracion', models.PositiveIntegerField()),
                ('lenguaje', multiselectfield.db.fields.MultiSelectField(choices=[('ES', 'Español'), ('EN', 'Ingles')], max_length=5, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('product_id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(default='Producto', max_length=50)),
                ('precio', models.DecimalField(decimal_places=2, max_digits=10, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))])),
                ('tipo', models.CharField(choices=[('DU', 'Dulce'), ('SA', 'Salado'), ('BE', 'Bebida')], default=('DU', 'Dulce'), max_length=2)),
            ],
        ),
        migrations.CreateModel(
            name='Sede',
            fields=[
                ('sede_id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=20)),
                ('ubicacion', models.CharField(max_length=20)),
                ('nro_salas', models.PositiveIntegerField(default=0, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Sede_producto',
            fields=[
                ('num_relacion', models.AutoField(primary_key=True, serialize=False)),
                ('product_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Producto')),
                ('sede_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Sede')),
            ],
        ),
        migrations.CreateModel(
            name='Sala',
            fields=[
                ('sala_id', models.AutoField(primary_key=True, serialize=False)),
                ('num_butacas', models.PositiveIntegerField()),
                ('disponibilidad', models.IntegerField(blank=True, default=0, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))])),
                ('sede_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Sede')),
            ],
        ),
        migrations.CreateModel(
            name='Funcion',
            fields=[
                ('id_funcion', models.AutoField(primary_key=True, serialize=False)),
                ('fecha_funcion', models.DateField()),
                ('horario', models.CharField(choices=[('10', '10:00 am'), ('12', '12:00 pm'), ('2', '2:00 pm'), ('4', '4:00 pm'), ('6', '6:00 pm'), ('8', '8:00 pm')], default=('10', '10:00 am'), max_length=4)),
                ('pelicula_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Pelicula')),
                ('sala_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Sala')),
            ],
        ),
        migrations.CreateModel(
            name='Factura_producto',
            fields=[
                ('num_relacion', models.AutoField(primary_key=True, serialize=False)),
                ('num_factura', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Factura')),
                ('product_id', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Producto')),
            ],
        ),
        migrations.CreateModel(
            name='Factura_entrada',
            fields=[
                ('num_relacion', models.AutoField(primary_key=True, serialize=False)),
                ('num_entrada', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Entrada')),
                ('num_factura', models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Factura')),
            ],
        ),
        migrations.AddField(
            model_name='factura',
            name='sede_id',
            field=models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Sede'),
        ),
        migrations.AddField(
            model_name='entrada',
            name='funcion_id',
            field=models.ForeignKey(default=1, null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.Funcion'),
        ),
    ]
