# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-27 05:42
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('title', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Reader',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('name', models.CharField(blank=True, max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Rental',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('rent_date', models.DateTimeField(default=django.utils.timezone.now)),
                ('return_date', models.DateTimeField(blank=True, null=True)),
                ('rating', models.DecimalField(decimal_places=1, default=5.0, max_digits=2)),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='example.Book')),
                ('reader', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='example.Reader')),
            ],
        ),
        migrations.AddField(
            model_name='book',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='example.Category'),
        ),
        migrations.AddField(
            model_name='book',
            name='readers',
            field=models.ManyToManyField(through='example.Rental', to='example.Reader'),
        ),
    ]
