# Generated by Django 3.0.4 on 2020-03-14 09:55

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Module',
            fields=[
                ('code', models.CharField(max_length=4, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='ModuleInstance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('semester', models.CharField(max_length=1)),
                ('year', models.CharField(max_length=4)),
                ('module', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ratemyprof.Module')),
            ],
        ),
        migrations.CreateModel(
            name='Professor',
            fields=[
                ('id', models.CharField(max_length=4, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.IntegerField(validators=[django.core.validators.MaxValueValidator(5), django.core.validators.MinValueValidator(0)])),
                ('module', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ratemyprof.Module')),
                ('moduleInstance', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ratemyprof.ModuleInstance')),
                ('prof', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ratemyprof.Professor')),
            ],
        ),
        migrations.AddField(
            model_name='moduleinstance',
            name='prof',
            field=models.ManyToManyField(to='ratemyprof.Professor'),
        ),
    ]
