# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-14 09:28
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Books',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=70)),
            ],
            options={
                'db_table': 'books',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='PurchaseHistory',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('quantity', models.IntegerField()),
                ('rating', models.DecimalField(decimal_places=2, max_digits=5)),
                ('rating_count', models.IntegerField()),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.Books')),
            ],
            options={
                'db_table': 'purchase_history',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='UserBoughtHistory',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('is_bought', models.BooleanField()),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.Books')),
            ],
            options={
                'db_table': 'user_bought_history',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='UserClickHistory',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('clicks', models.IntegerField()),
                ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.Books')),
            ],
            options={
                'db_table': 'user_click_history',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=70)),
            ],
            options={
                'db_table': 'users',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='userclickhistory',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.Users'),
        ),
        migrations.AddField(
            model_name='userboughthistory',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.Users'),
        ),
    ]
