# Generated by Django 2.0 on 2018-05-04 07:38

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

import meat.utils.mixin
import raw.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('default_price', models.FloatField(default=0)),
                ('type', models.CharField(blank=True, max_length=50, null=True)),
                ('state', models.IntegerField(default=1)),
            ],
            bases=(models.Model, meat.utils.mixin.DictMixin),
        ),
        migrations.CreateModel(
            name='CollectDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField()),
                ('weight', models.FloatField()),
                ('price', models.FloatField()),
            ],
            bases=(models.Model, meat.utils.mixin.DictMixin),
        ),
        migrations.CreateModel(
            name='CollectInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sg_no', models.CharField(max_length=50)),
                ('sg_datetime', models.DateTimeField(auto_now=True)),
                ('cz_weight', models.FloatField(default=0)),
                ('cz_number', models.IntegerField(default=0)),
                ('sg_source', models.CharField(default='', max_length=100)),
                ('state', models.IntegerField(default=1)),
            ],
            bases=(models.Model, meat.utils.mixin.DictMixin),
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('id_card', models.CharField(max_length=20)),
                ('cust_name', models.CharField(max_length=20)),
                ('address', models.CharField(max_length=255)),
                ('mobile', models.CharField(max_length=20)),
            ],
            options={
                'permissions': (('view_customer', '允许查看'), ('manage_customer', '允许管理（CRUD）')),
            },
            bases=(models.Model, meat.utils.mixin.DictMixin),
        ),
        migrations.CreateModel(
            name='PayInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pay_money', models.FloatField(default=0)),
                ('create_at', models.DateTimeField(auto_now=True)),
                ('collect_info', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='raw.CollectInfo')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pay_user', to=settings.AUTH_USER_MODEL)),
            ],
            bases=(models.Model, meat.utils.mixin.DictMixin),
        ),
        migrations.CreateModel(
            name='RawConfig',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default_number', models.IntegerField(default=5)),
                ('default_tare', models.FloatField(default=0)),
                ('unit_of_weight', models.CharField(default='KG', max_length=10)),
                ('unit_of_number', models.CharField(default='只(头)', max_length=10)),
            ],
            options={
                'permissions': (('view_config', '允许查看'), ('manage_config', '允许管理（CRUD）')),
            },
            bases=(models.Model, meat.utils.mixin.DictMixin),
        ),
        migrations.AddField(
            model_name='collectinfo',
            name='customer',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='raw.Customer'),
        ),
        migrations.AddField(
            model_name='collectinfo',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='collect_user', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='collectdetail',
            name='collect_info',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='raw.CollectInfo'),
        ),
    ]
