# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-10-22 17:11
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [

        migrations.CreateModel(
            name='Banners',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('img', models.ImageField(upload_to='banners')),
                ('car_id', models.CharField(max_length=128, null=True)),
                ('content', models.TextField(null=True)),
                ('look', models.IntegerField(default=1)),
                ('weight', models.IntegerField(default=1)),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'db_table': 'By_banners',
            },
        ),
        migrations.CreateModel(
            name='Brands',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
                ('logo', models.ImageField(default='https://sta.guazistatic.com/static/c2c/web/che-logo/dongfengxiaokang.png', upload_to='brands/logo')),
            ],
            options={
                'db_table': 'By_brands',
            },
        ),
        migrations.CreateModel(
            name='Cars',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('img1', models.ImageField(upload_to='')),
                ('img2', models.ImageField(null=True, upload_to='')),
                ('img3', models.ImageField(null=True, upload_to='')),
                ('img4', models.ImageField(null=True, upload_to='')),
                ('img5', models.ImageField(null=True, upload_to='')),
                ('time', models.CharField(max_length=128)),
                ('issue_time', models.DateTimeField(default=django.utils.timezone.now, max_length=128)),
                ('km', models.FloatField()),
                ('displacement', models.FloatField()),
                ('gearbox', models.CharField(max_length=16)),
                ('price', models.FloatField()),
                ('s_price', models.FloatField()),
                ('trait', models.IntegerField(choices=[(0, '新上架'), (1, '普通车'), (2, '严选车'), (3, '超值购')], default=1)),
                ('new_car', models.IntegerField(choices=[(0, '准新车'), (1, '普通车')], default=0)),
                ('protect', models.IntegerField(choices=[(0, '质保'), (1, '无质保')], default=0)),
                ('transfer', models.IntegerField(default=0)),
                ('color', models.IntegerField(choices=[(0, '黑色'), (1, '白色')], default=0)),
                ('info', models.CharField(max_length=256, null=True)),
            ],
            options={
                'db_table': 'By_cars',
            },
        ),
        migrations.CreateModel(
            name='CarsSeries',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
                ('brand', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.Brands')),
            ],
            options={
                'db_table': 'By_cars_series',
            },
        ),
        migrations.CreateModel(
            name='CarsTypes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
            ],
            options={
                'db_table': 'By_cars_types',
            },
        ),
        migrations.CreateModel(
            name='CorporateCulture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Fwb',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='Issue_Cars',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('img', models.ImageField(upload_to='issue_cars/img')),
                ('time', models.CharField(max_length=128)),
                ('issue_time', models.DateTimeField(default=django.utils.timezone.now, max_length=128)),
                ('km', models.FloatField()),
                ('displacement', models.FloatField()),
                ('gearbox', models.CharField(max_length=16)),
                ('price', models.FloatField()),
                ('s_price', models.FloatField()),
                ('failed_content', models.TextField(blank=True, null=True)),
                ('is_check', models.IntegerField(choices=[(0, '待审核'), (1, '审核通过'), (2, '审核未通过')], default=0)),
                ('info', models.CharField(max_length=256, null=True)),
                ('car_serie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.CarsSeries')),
                ('car_type', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.CarsTypes')),
            ],
            options={
                'db_table': 'By_issue_cars',
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('new', models.ImageField(upload_to='news')),
                ('title', models.CharField(max_length=128)),
                ('content', models.CharField(max_length=512)),
            ],
            options={
                'db_table': 'By_news',
            },
        ),

        migrations.CreateModel(
            name='SellCars',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('img', models.ImageField(upload_to='sell_cars/img')),
                ('time', models.CharField(max_length=128)),
                ('issue_time', models.DateTimeField(max_length=128)),
                ('sell_time', models.DateTimeField(default=django.utils.timezone.now, max_length=128)),
                ('km', models.FloatField()),
                ('displacement', models.FloatField()),
                ('gearbox', models.CharField(max_length=16)),
                ('price', models.FloatField()),
                ('s_price', models.FloatField()),
                ('info', models.CharField(max_length=256, null=True)),
                ('car_serie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.CarsSeries')),
                ('car_type', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.CarsTypes')),
            ],
            options={
                'db_table': 'By_sell_cars',
            },
        ),

        migrations.CreateModel(
            name='Users',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('openid', models.CharField(default=666, max_length=64)),
                ('name', models.CharField(max_length=64)),
                ('icon', models.ImageField(upload_to='users/icon')),
                ('phone', models.CharField(max_length=12, unique=True)),
                ('u_property', models.IntegerField(choices=[(0, '个人'), (1, '商户')], default=0)),
                ('u_time', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'By_users',
            },
        ),
        migrations.AddField(
            model_name='sellcars',
            name='sell_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.Users'),
        ),
        migrations.AddField(
            model_name='issue_cars',
            name='issue_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.Users'),
        ),
        migrations.AddField(
            model_name='cars',
            name='car_serie',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.CarsSeries'),
        ),
        migrations.AddField(
            model_name='cars',
            name='car_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Bo_yuan.CarsTypes'),
        ),
        migrations.AddField(
            model_name='cars',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cars_user', to='Bo_yuan.Users'),
        ),
    ]
