# Generated by Django 2.2.5 on 2019-10-19 18:04

import datetime
from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='Agenda',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
                ('descricao', models.CharField(max_length=500)),
                ('tipo', models.CharField(choices=[['Individual', 'Individual'], ['Individual', 'Grupo']], max_length=10)),
                ('data_disponibilizacao', models.DateField(default=datetime.datetime.now)),
                ('data_encerramento', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='Grupo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Periodo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ano', models.PositiveSmallIntegerField(choices=[(2019, 2019)])),
                ('semestre', models.PositiveSmallIntegerField(choices=[(1, 1), (2, 2)])),
            ],
            options={
                'ordering': ['-ano', '-semestre'],
                'unique_together': {('ano', 'semestre')},
            },
        ),
        migrations.CreateModel(
            name='Turma',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('descricao', models.CharField(max_length=2, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Registro',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('matricula', models.CharField(max_length=9, validators=[django.core.validators.RegexValidator(regex='^\\d{9}$')])),
                ('periodo', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='amika.Periodo')),
                ('turma', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='amika.Turma')),
            ],
            options={
                'ordering': ['-periodo', 'turma', 'matricula'],
                'unique_together': {('matricula', 'periodo')},
            },
        ),
        migrations.CreateModel(
            name='Aluno',
            fields=[
                ('user_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('grupo', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='amika.Grupo')),
                ('registro', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='amika.Registro')),
            ],
            options={
                'ordering': ['username'],
            },
            bases=('auth.user',),
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
