# Generated by Django 2.1.1 on 2018-11-19 18:03

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AnswerTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.CharField(max_length=30000)),
                ('creationTime', models.DateTimeField(null=True)),
                ('modifiedTime', models.DateTimeField(null=True)),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'AnswerTable',
            },
        ),
        migrations.CreateModel(
            name='CommentTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.CharField(max_length=1024)),
                ('creationTime', models.DateTimeField(null=True)),
                ('modifiedTime', models.DateTimeField(null=True)),
                ('answer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='IDK_rest.AnswerTable')),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'CommentTable',
            },
        ),
        migrations.CreateModel(
            name='FollowTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('follower', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='follower', to=settings.AUTH_USER_MODEL)),
                ('following', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='following', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'FollowTable',
            },
        ),
        migrations.CreateModel(
            name='NotificationTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='IDK_rest.CommentTable')),
                ('fromUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fromUser', to=settings.AUTH_USER_MODEL)),
                ('toUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='toUser', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'NotificationTable',
            },
        ),
        migrations.CreateModel(
            name='QuestionTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reputationThreshold', models.IntegerField(default=0)),
                ('title', models.CharField(max_length=200)),
                ('body', models.CharField(max_length=30000)),
                ('creationTime', models.DateTimeField(null=True)),
                ('modificationTime', models.DateTimeField(null=True)),
                ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'QuestionTable',
            },
        ),
        migrations.CreateModel(
            name='ScoreTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('scoreVal', models.IntegerField()),
                ('answer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='IDK_rest.AnswerTable')),
                ('question', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='IDK_rest.QuestionTable')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'ScoreTable',
            },
        ),
        migrations.CreateModel(
            name='TagTable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
            ],
            options={
                'verbose_name_plural': 'TagTable',
            },
        ),
        migrations.AddField(
            model_name='questiontable',
            name='tags',
            field=models.ManyToManyField(to='IDK_rest.TagTable'),
        ),
        migrations.AddField(
            model_name='commenttable',
            name='question',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='IDK_rest.QuestionTable'),
        ),
        migrations.AddField(
            model_name='answertable',
            name='parent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='IDK_rest.QuestionTable'),
        ),
        migrations.AddField(
            model_name='answertable',
            name='tags',
            field=models.ManyToManyField(to='IDK_rest.TagTable'),
        ),
    ]
