# Generated by Django 3.1.3 on 2020-11-04 13:38

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Customers',
            fields=[
                ('cust_id', models.CharField(db_column='cust_id', max_length=10, primary_key=True, serialize=False, verbose_name='唯一的顾客ID')),
                ('cust_name', models.CharField(max_length=50, verbose_name='顾客名')),
                ('cust_address', models.CharField(max_length=50, null=True, verbose_name='顾客的地址')),
                ('cust_city', models.CharField(max_length=50, null=True, verbose_name='顾客所在城市')),
                ('cust_state', models.CharField(max_length=5, null=True, verbose_name='顾客所在州')),
                ('cust_zip', models.CharField(max_length=10, null=True, verbose_name='顾客地址邮政编码')),
                ('cust_country', models.CharField(max_length=50, null=True, verbose_name='顾客所在国家')),
                ('cust_contact', models.CharField(max_length=50, null=True, verbose_name='顾客的联系名')),
                ('cust_email', models.CharField(max_length=255, null=True, verbose_name='顾客的e-mail')),
            ],
            options={
                'verbose_name': '客户表',
                'verbose_name_plural': '客户表',
                'db_table': 'Customers',
            },
        ),
        migrations.CreateModel(
            name='Vendors',
            fields=[
                ('vend_id', models.CharField(db_column='vend_id', max_length=10, primary_key=True, serialize=False, verbose_name='唯一的供应商ID')),
                ('vend_name', models.CharField(max_length=50, verbose_name='供应商名')),
                ('vend_address', models.CharField(max_length=50, null=True, verbose_name='供应商的地址')),
                ('vend_city', models.CharField(max_length=50, null=True, verbose_name='供应商所在的城市')),
                ('vend_state', models.CharField(max_length=5, null=True, verbose_name='供应商所在的州')),
                ('vend_zip', models.CharField(max_length=10, null=True, verbose_name='供应商地址邮政编码')),
                ('vend_country', models.CharField(max_length=50, null=True, verbose_name='供应商所在国家')),
            ],
            options={
                'verbose_name': '供应商表',
                'verbose_name_plural': '供应商表',
                'db_table': 'Vendors',
            },
        ),
        migrations.CreateModel(
            name='Products',
            fields=[
                ('prod_id', models.CharField(db_column='prod_id', max_length=10, primary_key=True, serialize=False, verbose_name='唯一的产品ID')),
                ('prod_name', models.CharField(max_length=255, verbose_name='产品名')),
                ('prod_price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='产品价格')),
                ('prod_desc', models.TextField(null=True, verbose_name='产品描述')),
                ('vend_id', models.ForeignKey(db_column='vend_id', help_text='关联到Vendors表的vend_id', on_delete=django.db.models.deletion.CASCADE, to='create_table.vendors', verbose_name='产品供应商ID')),
            ],
            options={
                'verbose_name': '产品目录表',
                'verbose_name_plural': '产品目录表',
                'db_table': 'Products',
            },
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('order_num', models.IntegerField(db_column='order_num', primary_key=True, serialize=False, verbose_name='唯一的订单号')),
                ('order_date', models.DateTimeField(verbose_name='订单的日期')),
                ('cust_id', models.ForeignKey(db_column='cust_id', help_text='关联到Customer表的cust_id', on_delete=django.db.models.deletion.CASCADE, to='create_table.customers', verbose_name='订单顾客的ID')),
            ],
            options={
                'verbose_name': '订单表',
                'verbose_name_plural': '订单表',
                'db_table': 'Orders',
            },
        ),
        migrations.CreateModel(
            name='OrderItems',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_item', models.IntegerField(help_text='订单内的顺序', verbose_name='订单物品号')),
                ('quantity', models.IntegerField(verbose_name='物品数量')),
                ('item_price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='物品价格')),
                ('order_num', models.ForeignKey(db_column='order_num', help_text='关联到Order表的order_num', on_delete=django.db.models.deletion.CASCADE, to='create_table.orders', verbose_name='订单号')),
                ('prod_id', models.ForeignKey(db_column='prod_id', help_text='关联到Products表的prod_id', on_delete=django.db.models.deletion.CASCADE, to='create_table.products', verbose_name='产品ID')),
            ],
            options={
                'verbose_name': '订单项目表',
                'verbose_name_plural': '订单项目表',
                'db_table': 'OrderItems',
                'unique_together': {('order_num', 'order_item')},
            },
        ),
    ]
