# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-10-22 22:59
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('log_reg', '0003_auto_20181022_1346'),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('Edition', models.SmallIntegerField()),
                ('Publisher', models.CharField(max_length=255)),
                ('author', models.CharField(max_length=255)),
                ('cover', models.ImageField(blank=True, null=True, upload_to='covers/')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Sells',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('condition', models.SmallIntegerField()),
                ('price', models.IntegerField(null=True)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='user_pics/')),
                ('description', models.TextField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='for_sale', to='Textbooks.Book')),
                ('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sells', to='log_reg.User')),
            ],
        ),
        migrations.CreateModel(
            name='Wants',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('condition', models.SmallIntegerField()),
                ('price', models.IntegerField(null=True)),
                ('distance', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wanted', to='Textbooks.Book')),
                ('buyer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wants', to='log_reg.User')),
            ],
        ),
        migrations.AddField(
            model_name='message',
            name='on_book',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='Textbooks.Sells'),
        ),
        migrations.AddField(
            model_name='message',
            name='posted_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='log_reg.User'),
        ),
        migrations.AddField(
            model_name='comment',
            name='on_message',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='Textbooks.Message'),
        ),
    ]
