# Generated by Django 2.0.4 on 2018-08-27 18:12

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Materiales',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('cantidad', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='MaterialSolicitado',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=100)),
                ('cantidad', models.IntegerField()),
                ('urgencia', models.CharField(choices=[('urgente', 'Urgente'), ('normal', 'Normal'), ('baja', 'Baja')], max_length=10)),
                ('unidades', models.CharField(max_length=20)),
                ('recibido', models.CharField(blank=True, choices=[('si', 'Si'), ('no', 'No')], max_length=2)),
            ],
        ),
        migrations.CreateModel(
            name='Obra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('direccion', models.CharField(max_length=100)),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='OrdenCompra',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fecha', models.DateField()),
                ('material', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='SolicitudMaterial',
            fields=[
                ('numero_orden', models.AutoField(primary_key=True, serialize=False)),
                ('fecha_solicitud', models.DateField()),
                ('fecha_requerida', models.DateField()),
                ('fecha_estimada', models.DateField(blank=True, null=True)),
                ('estado_solicitud', models.CharField(blank=True, choices=[('recibida', 'Recibida'), ('no atendida', 'No antendida'), ('en cotización', 'En cotización'), ('en camino', 'En camino')], default='no atendida', max_length=20, null=True)),
                ('obra', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GPI.Obra')),
            ],
        ),
        migrations.CreateModel(
            name='MyUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('first_name', models.CharField(max_length=254)),
                ('second_name', models.CharField(blank=True, max_length=254)),
                ('apellido_paterno', models.CharField(max_length=254)),
                ('apellido_materno', models.CharField(blank=True, max_length=254)),
                ('rut', models.CharField(max_length=9)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
                ('is_bodeguero', models.BooleanField(default=False)),
                ('is_trabajador_obra', models.BooleanField(default=False)),
                ('is_encargado_compras', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
        ),
        migrations.CreateModel(
            name='Bodeguero',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='EncargadoCompras',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TrabajadorObra',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='myuser',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='myuser',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='ordencompra',
            name='solicitudmaterial',
            field=models.ManyToManyField(to='GPI.SolicitudMaterial'),
        ),
        migrations.AddField(
            model_name='materialsolicitado',
            name='solicitud',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GPI.SolicitudMaterial'),
        ),
        migrations.AddField(
            model_name='materiales',
            name='obra',
            field=models.ManyToManyField(to='GPI.Obra'),
        ),
        migrations.AddField(
            model_name='solicitudmaterial',
            name='trabajadorobra',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GPI.TrabajadorObra'),
        ),
        migrations.AddField(
            model_name='ordencompra',
            name='encargadocompras',
            field=models.ManyToManyField(to='GPI.EncargadoCompras'),
        ),
        migrations.AddField(
            model_name='obra',
            name='bodeguero',
            field=models.ManyToManyField(to='GPI.Bodeguero'),
        ),
        migrations.AddField(
            model_name='obra',
            name='trabajadorobra',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='GPI.TrabajadorObra'),
        ),
    ]
