# Generated by Django 3.1.5 on 2021-04-07 15:33

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('brand', '0001_initial'),
        ('category', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250, verbose_name='상품이름')),
                ('code', models.CharField(max_length=100, unique=True, verbose_name='상품코드')),
                ('summary', models.CharField(default='', max_length=250, verbose_name='상품 간략설명')),
                ('description', models.TextField(default='', verbose_name='상품 상세설명 ')),
                ('types', models.CharField(choices=[('CP', '소모품'), ('SP', '서비스 상품'), ('IP', '재고관리 상품')], max_length=10, verbose_name='상품타입')),
                ('orders', models.IntegerField(default=0, verbose_name='순서')),
                ('price', models.IntegerField(default=0, verbose_name='상품가격')),
                ('saleOption', models.CharField(choices=[('NR', '할인 없음'), ('FA', '고정 금액 할인'), ('DR', '할인율')], default='NR', max_length=10, verbose_name='할인옵션')),
                ('salePrice', models.IntegerField(default=0, verbose_name='할인 가격')),
                ('sale_ok', models.BooleanField(default=True, verbose_name='상품 판매여부')),
                ('inventory', models.IntegerField(default=1, verbose_name='상품 수량')),
                ('create_at', models.DateTimeField(auto_now_add=True, verbose_name='생성일자')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='수정일자')),
                ('brand', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='brand.brand')),
                ('category', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='category.category')),
            ],
            options={
                'verbose_name': 'product',
                'verbose_name_plural': 'products',
                'db_table': 'rt_product',
                'ordering': ('-orders', 'updated'),
            },
        ),
        migrations.CreateModel(
            name='ProductOptionDetail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=100, verbose_name='Code')),
                ('price', models.IntegerField(default=0, verbose_name='Price')),
                ('saleOption', models.CharField(choices=[('NR', '할인 없음'), ('FA', '고정 금액 할인'), ('DR', '할인율')], max_length=10, verbose_name='Sale Option')),
                ('salePrice', models.IntegerField(default=0, verbose_name='Sale Price')),
                ('quantity', models.IntegerField(default=1, verbose_name='Quantity')),
                ('sale_ok', models.BooleanField(default=False, verbose_name='Sale OK')),
                ('create_at', models.DateTimeField(auto_now_add=True, verbose_name='Create Date')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Update Date')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
            ],
            options={
                'verbose_name': 'product_option_detail',
                'verbose_name_plural': 'product_option_details',
                'db_table': 'rt_product_option_detail',
                'ordering': ('-updated',),
            },
        ),
        migrations.CreateModel(
            name='ProductOption',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='Name')),
                ('values', models.CharField(max_length=500, verbose_name='Values')),
                ('create_at', models.DateTimeField(auto_now_add=True, verbose_name='Create Date')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Update Date')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
            ],
            options={
                'verbose_name': 'product_option',
                'verbose_name_plural': 'product_options',
                'db_table': 'rt_product_option',
                'ordering': ('-updated',),
            },
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(default='', upload_to='administrator/')),
                ('thumbnail', models.ImageField(default='', upload_to='administrator/thumbnail')),
                ('create_at', models.DateTimeField(auto_now_add=True, verbose_name='Create Date')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Update Date')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
            ],
            options={
                'verbose_name': 'product_image',
                'verbose_name_plural': 'product_images',
                'db_table': 'rt_product_image',
                'ordering': ('-updated',),
            },
        ),
    ]
