# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-11 13:15
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='AccessToken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('session_key', models.CharField(max_length=255)),
                ('open_id', models.CharField(max_length=255)),
                ('token', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.CharField(max_length=255)),
                ('address', models.CharField(max_length=1024)),
                ('link_man', models.CharField(max_length=255)),
                ('status', models.CharField(max_length=255)),
                ('date_update', models.DateField()),
                ('is_default', models.BooleanField()),
                ('province', models.CharField(max_length=255)),
                ('province_id', models.IntegerField()),
                ('city', models.CharField(max_length=255)),
                ('city_id', models.IntegerField()),
                ('area', models.CharField(max_length=255)),
                ('code', models.CharField(max_length=255, verbose_name='\u5907\u6ce8')),
            ],
        ),
        migrations.CreateModel(
            name='AppConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sub_domain', models.CharField(max_length=255)),
                ('host', models.CharField(max_length=255)),
                ('mall_name', models.CharField(max_length=255)),
                ('app_id', models.CharField(max_length=255)),
                ('secret', models.CharField(max_length=255)),
                ('wechat_pay_id', models.CharField(max_length=255)),
                ('wechat_pay_secret', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=1024, verbose_name='\u6807\u9898')),
                ('cover', models.ImageField(upload_to='img', verbose_name='\u5c01\u9762\u56fe\u7247')),
                ('content', models.TextField(verbose_name='\u6587\u7ae0\u5185\u5bb9')),
                ('date', models.DateTimeField(verbose_name='\u65e5\u671f')),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.AppConfig')),
            ],
        ),
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sub_domain', models.CharField(max_length=255)),
                ('title', models.CharField(max_length=255)),
                ('display_pic', models.ImageField(upload_to='img')),
                ('link_url', models.CharField(max_length=255)),
                ('remark', models.CharField(max_length=255)),
                ('status', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sub_domain', models.CharField(help_text='\u5b50\u57df\u540d', max_length=255)),
                ('key', models.CharField(help_text='key', max_length=255)),
                ('name', models.CharField(help_text='\u5546\u54c1\u7c7b\u522b', max_length=255)),
                ('c_type', models.CharField(max_length=255)),
                ('icon', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Discount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('man', models.IntegerField()),
                ('jian', models.IntegerField()),
                ('status', models.IntegerField()),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.AppConfig')),
            ],
        ),
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('characteristic', models.CharField(max_length=255)),
                ('display_pic', models.ImageField(upload_to='img')),
                ('content', models.CharField(max_length=255)),
                ('number_order', models.IntegerField()),
                ('original_price', models.FloatField()),
                ('min_price', models.FloatField()),
                ('number_good_reputation', models.IntegerField(default=0)),
                ('weight', models.FloatField()),
                ('stores', models.IntegerField()),
                ('app_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.AppConfig')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_num', models.CharField(max_length=255)),
                ('address', models.CharField(max_length=1024)),
                ('number_goods', models.IntegerField()),
                ('goods_price', models.FloatField()),
                ('logistics_price', models.FloatField()),
                ('total', models.FloatField()),
                ('status', models.IntegerField()),
                ('tracking_number', models.CharField(max_length=255)),
                ('date', models.DateTimeField()),
                ('remark', models.CharField(max_length=1024)),
                ('link_man', models.CharField(max_length=255, verbose_name='\u8054\u7cfb\u4eba')),
                ('province_id', models.IntegerField()),
                ('city_id', models.IntegerField()),
                ('phone', models.CharField(max_length=255)),
                ('goods', models.ManyToManyField(to='app1.Goods')),
            ],
        ),
        migrations.CreateModel(
            name='OrderGoods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField()),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.Goods')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='goods_amount', to='app1.Order')),
            ],
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(max_length=255)),
                ('remark', models.CharField(max_length=255)),
                ('openid', models.CharField(max_length=255)),
                ('price', models.FloatField()),
                ('result_code', models.CharField(max_length=255)),
                ('err_code', models.CharField(max_length=255)),
                ('err_code_des', models.CharField(max_length=255)),
                ('transaction_id', models.CharField(max_length=255)),
                ('bank_type', models.CharField(max_length=255)),
                ('fee_type', models.CharField(max_length=255)),
                ('total_fee', models.IntegerField()),
                ('settlement_total_fee', models.IntegerField()),
                ('cash_fee', models.IntegerField()),
                ('cash_fee_type', models.CharField(max_length=255)),
                ('coupon_fee', models.IntegerField()),
                ('coupon_count', models.IntegerField()),
                ('create_time', models.IntegerField()),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pays', to='app1.Order')),
            ],
        ),
        migrations.CreateModel(
            name='Picture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('pic', models.ImageField(upload_to='img')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pics', to='app1.Goods')),
            ],
        ),
        migrations.CreateModel(
            name='WechatUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('open_id', models.CharField(max_length=255)),
                ('gender', models.CharField(max_length=255)),
                ('language', models.CharField(max_length=255)),
                ('province', models.CharField(max_length=255)),
                ('city', models.CharField(max_length=255)),
                ('register_type', models.CharField(max_length=255)),
                ('register_ip', models.CharField(max_length=255)),
                ('last_login', models.DateField()),
                ('phone', models.CharField(max_length=255)),
                ('union_id', models.CharField(max_length=255)),
                ('ip', models.CharField(max_length=255)),
                ('status', models.CharField(default='default', max_length=255)),
                ('app_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.AppConfig')),
            ],
        ),
        migrations.AddField(
            model_name='payment',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.WechatUser'),
        ),
        migrations.AddField(
            model_name='order',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.WechatUser'),
        ),
        migrations.AddField(
            model_name='banner',
            name='goods',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app1.Goods'),
        ),
        migrations.AddField(
            model_name='address',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='addr', to='app1.WechatUser'),
        ),
    ]
