# Generated by Django 2.0 on 2017-12-31 02:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('cid', models.AutoField(primary_key=True, serialize=False)),
                ('cname', models.CharField(max_length=20, verbose_name='Name')),
                ('caddr', models.CharField(max_length=100, null=True, verbose_name='Address')),
                ('cphone', models.CharField(max_length=15, null=True, verbose_name='Phone')),
                ('cwechat', models.CharField(max_length=20, null=True, verbose_name='Wechat')),
                ('cdate', models.DateTimeField(verbose_name='Date Created')),
                ('cnote', models.CharField(max_length=100, null=True, verbose_name='Note')),
            ],
        ),
        migrations.CreateModel(
            name='Inventory',
            fields=[
                ('iid', models.AutoField(primary_key=True, serialize=False)),
                ('idate', models.DateTimeField(verbose_name='Date Received')),
                ('icost', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Total Value')),
                ('ishipping', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Shipping Cost')),
                ('itype', models.CharField(max_length=20, null=True, verbose_name='Shipping Method')),
                ('inote', models.CharField(max_length=100, null=True, verbose_name='Note')),
            ],
        ),
        migrations.CreateModel(
            name='Inventorycontains',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('iquantity', models.IntegerField(verbose_name='Inventory Quantity')),
                ('iprice', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Inventory Price')),
                ('iid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backend.Inventory')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('oid', models.CharField(max_length=30, primary_key=True, serialize=False)),
                ('odate', models.DateTimeField(verbose_name='Date Ordered')),
                ('oshipdate', models.DateTimeField(null=True, verbose_name='Date Shipped')),
                ('opaid', models.BooleanField(verbose_name='Is this order paid?')),
                ('ototal', models.DecimalField(decimal_places=2, max_digits=10, null=True, verbose_name='Total amount')),
                ('oshipping', models.DecimalField(decimal_places=2, max_digits=10, null=True, verbose_name='Shipping Cost')),
                ('opaymentmethod', models.CharField(max_length=20, null=True, verbose_name='Payment method')),
                ('ostatus', models.CharField(max_length=20, verbose_name='Status')),
                ('onote', models.CharField(max_length=100, null=True, verbose_name='Note')),
                ('cid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backend.Customer')),
            ],
        ),
        migrations.CreateModel(
            name='Ordercontains',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('oquantity', models.IntegerField(verbose_name='Order Quantity')),
                ('oprice', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Order Price')),
                ('oid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backend.Order')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('pid', models.AutoField(primary_key=True, serialize=False)),
                ('pname', models.CharField(max_length=40, verbose_name='Product Name')),
                ('ptype', models.CharField(max_length=20, null=True, verbose_name='Product Type')),
                ('pcost', models.DecimalField(decimal_places=2, max_digits=10, null=True, verbose_name='Product Cost')),
                ('pprice', models.DecimalField(decimal_places=2, max_digits=10, null=True, verbose_name='Product Price')),
                ('pnote', models.CharField(max_length=100, null=True, verbose_name='Note')),
            ],
        ),
        migrations.AddField(
            model_name='ordercontains',
            name='pid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backend.Product'),
        ),
        migrations.AddField(
            model_name='inventorycontains',
            name='pid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backend.Product'),
        ),
        migrations.AlterUniqueTogether(
            name='ordercontains',
            unique_together={('oid', 'pid')},
        ),
        migrations.AlterUniqueTogether(
            name='inventorycontains',
            unique_together={('iid', 'pid')},
        ),
    ]
