# Generated by Django 3.1.7 on 2021-08-14 06:28

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('doc', models.FileField(upload_to='files/')),
                ('description', models.CharField(max_length=400)),
                ('branch', models.CharField(choices=[('Computer Science & Engineering', 'Computer Science & Engineering'), ('Information Technology', 'Information Technology'), ('Mechanical Engineering', 'Mechanical Engineering'), ('Civil Engineering', 'Civil Engineering'), ('Electrical Engineering', 'Electrical Engineering'), ('Electronics & Telecommunication Engineering', 'Electronics & Telecommunication Engineering'), ('Industrial & Production Engineering', 'Industrial & Production Engineering')], max_length=50)),
                ('semester', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8)])),
                ('upload_date', models.DateTimeField(default=django.utils.timezone.now)),
                ('downvotes', models.ManyToManyField(blank=True, related_name='file_downvotes', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('description', models.CharField(max_length=400)),
                ('branch', models.CharField(choices=[('Computer Science & Engineering', 'Computer Science & Engineering'), ('Information Technology', 'Information Technology'), ('Mechanical Engineering', 'Mechanical Engineering'), ('Civil Engineering', 'Civil Engineering'), ('Electrical Engineering', 'Electrical Engineering'), ('Electronics & Telecommunication Engineering', 'Electronics & Telecommunication Engineering'), ('Industrial & Production Engineering', 'Industrial & Production Engineering')], max_length=50)),
                ('semester', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8)])),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('closing_response', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='answer', to='core.file')),
                ('downvotes', models.ManyToManyField(blank=True, related_name='req_downvotes', to=settings.AUTH_USER_MODEL)),
                ('upvotes', models.ManyToManyField(blank=True, related_name='req_upvotes', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='file',
            name='request',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='responses', to='core.request'),
        ),
        migrations.AddField(
            model_name='file',
            name='upvotes',
            field=models.ManyToManyField(blank=True, related_name='file_upvotes', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='file',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
