# Generated by Django 2.0.2 on 2018-02-13 11:55

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BookName',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bname', models.CharField(db_column='书名', db_index=True, max_length=30, verbose_name='书名')),
                ('bintroduction', models.CharField(db_column='简介', max_length=3000, verbose_name='简介')),
                ('bcomment', models.TextField(blank=True, db_column='评论', null=True, verbose_name='评论')),
                ('bauthor', models.CharField(db_column='作者', db_index=True, max_length=18, verbose_name='作者')),
                ('img', models.ImageField(blank=True, null=True, upload_to='static/bookshop/img')),
            ],
            options={
                'db_table': 'bookname',
            },
        ),
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('clist', models.CharField(db_index=True, max_length=30, verbose_name='目录')),
                ('ccontent', models.TextField(verbose_name='内容')),
                ('creattime', models.DateField(auto_now_add=True, db_index=True, verbose_name='创建时间')),
                ('views', models.IntegerField(default=0, verbose_name='点击数')),
                ('cbook', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='BookShop.BookName')),
            ],
            options={
                'db_table': 'chapter',
            },
        ),
        migrations.CreateModel(
            name='Classification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cname', models.CharField(db_column='分类名', max_length=18, verbose_name='分类名')),
            ],
            options={
                'db_table': 'classification',
            },
        ),
        migrations.CreateModel(
            name='Lunbo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name1', models.CharField(max_length=20, verbose_name='图片名')),
                ('img', models.ImageField(upload_to='static/bookshop/img/lunbo', verbose_name='轮播图片')),
                ('name', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='BookShop.BookName')),
            ],
            options={
                'db_table': 'lunbo',
            },
        ),
        migrations.CreateModel(
            name='States',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('state', models.CharField(max_length=10, verbose_name='图书状态')),
            ],
            options={
                'db_table': 'states',
            },
        ),
        migrations.AddField(
            model_name='bookname',
            name='bstates',
            field=models.ForeignKey(db_column='图书状态', on_delete=django.db.models.deletion.CASCADE, to='BookShop.States'),
        ),
        migrations.AddField(
            model_name='bookname',
            name='cfname',
            field=models.ForeignKey(db_column='类名', on_delete=django.db.models.deletion.CASCADE, to='BookShop.Classification'),
        ),
    ]
