# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-11-30 03:57
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=254, primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(help_text='Full name', max_length=100)),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into the admin site.', verbose_name='staff status')),
                ('groups', 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')),
            ],
            managers=[
                ('user_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Classroom',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='e.g. Classroom 101, Cafeteria', max_length=50)),
                ('code', models.CharField(help_text='Up to 3 letters to identify classroom in schedule - e.g. 101, CAF', max_length=3)),
            ],
        ),
        migrations.CreateModel(
            name='InventoryItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('model_identifier', models.CharField(help_text='e.g. Apple 13.3" MacBook Pro (Mid 2017, Space Gray)', max_length=200)),
                ('display_name', models.CharField(help_text='Short name to show in schedule - e.g. MacbookPro13-2017', max_length=50)),
                ('units', models.IntegerField(help_text='How many total functional units Aim High has available', validators=[django.core.validators.MinValueValidator(1)])),
            ],
            options={
                'verbose_name_plural': 'Inventory',
            },
        ),
        migrations.CreateModel(
            name='Period',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField(help_text='Determines the ordering of periods in a day. For example, if Period 4 is given number 4, and Activity 1 is given number 5, then Period 4 occurs right before Activity 1', validators=[django.core.validators.MinValueValidator(1)])),
                ('name', models.CharField(help_text='e.g. Period 3, Activity 2', max_length=12)),
            ],
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('units', models.IntegerField(validators=[django.core.validators.MinValueValidator(1)])),
                ('collaborative', models.BooleanField()),
                ('comment', models.CharField(blank=True, max_length=1000, null=True)),
                ('classroom', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Classroom')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('period', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Period')),
            ],
        ),
        migrations.CreateModel(
            name='Site',
            fields=[
                ('name', models.CharField(help_text='e.g. Francisco, Western Addition', max_length=100, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='SiteInventory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('storage_location', models.CharField(default="Site Director's office", help_text='e.g. Storage closet in classroom 201', max_length=100, null=True)),
                ('units', models.IntegerField(help_text='Number of units being assigned to this site', validators=[django.core.validators.MinValueValidator(1)])),
                ('inventory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.InventoryItem')),
                ('site', models.ForeignKey(help_text='Which site these units are being assigned to', on_delete=django.db.models.deletion.CASCADE, to='checkout.Site')),
            ],
            options={
                'verbose_name_plural': 'Site Inventory',
            },
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('members', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
                ('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Site')),
                ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Subject')),
            ],
        ),
        migrations.CreateModel(
            name='TechnologyCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='e.g. Laptop, Tablet, Projector', max_length=50)),
            ],
            options={
                'verbose_name_plural': 'Technology Categories',
            },
        ),
        migrations.CreateModel(
            name='UsagePurpose',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('purpose', models.CharField(help_text='e.g. Research (Google, Wikipedia, Wolfram Alpha etc.)', max_length=100)),
            ],
            options={
                'verbose_name_plural': 'Usage Purposes',
            },
        ),
        migrations.CreateModel(
            name='Week',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('week_number', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)])),
                ('pickled_days', models.CharField(max_length=1024)),
                ('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Site')),
            ],
        ),
        migrations.AddField(
            model_name='reservation',
            name='purpose',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='checkout.UsagePurpose'),
        ),
        migrations.AddField(
            model_name='reservation',
            name='site_inventory',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.SiteInventory'),
        ),
        migrations.AddField(
            model_name='reservation',
            name='team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Team'),
        ),
        migrations.AddField(
            model_name='inventoryitem',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.TechnologyCategory'),
        ),
        migrations.AddField(
            model_name='classroom',
            name='site',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='checkout.Site'),
        ),
        migrations.AddField(
            model_name='user',
            name='site',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='checkout.Site'),
        ),
        migrations.AddField(
            model_name='user',
            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.AlterUniqueTogether(
            name='week',
            unique_together=set([('site', 'week_number')]),
        ),
        migrations.AlterUniqueTogether(
            name='siteinventory',
            unique_together=set([('site', 'inventory')]),
        ),
        migrations.AlterUniqueTogether(
            name='reservation',
            unique_together=set([('team', 'site_inventory', 'classroom', 'date', 'period')]),
        ),
        migrations.AlterUniqueTogether(
            name='classroom',
            unique_together=set([('site', 'code'), ('site', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='user',
            unique_together=set([('site', 'name')]),
        ),
    ]
