# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-16 11:50
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('shoppingmall_admin', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Groupon',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('title', models.CharField(db_column='TITLE', max_length=100)),
                ('picture', models.CharField(blank=True, db_column='PICTURE', max_length=300, null=True)),
                ('original_price', models.DecimalField(db_column='ORIGINAL_PRICE', decimal_places=2, max_digits=10)),
                ('current_price', models.DecimalField(db_column='CURRENT_PRICE', decimal_places=2, max_digits=10)),
                ('start_time', models.DateField(db_column='START_TIME')),
                ('end_time', models.DateField(db_column='END_TIME')),
                ('details', models.TextField(db_column='DETAILS')),
                ('create_time', models.DateTimeField(blank=True, db_column='CREATE_TIME', null=True)),
                ('shop', models.ForeignKey(db_column='SHOP_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Shop')),
            ],
            options={
                'db_table': 'groupon',
            },
        ),
        migrations.CreateModel(
            name='GrouponBackage',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('code', models.CharField(blank=True, db_column='CODE', max_length=45, null=True)),
                ('groupon_type', models.CharField(blank=True, db_column='GROUPON_TYPE', max_length=48, null=True)),
                ('member', models.ForeignKey(db_column='MEMBER_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Member')),
                ('status', models.ForeignKey(db_column='STATUS_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.TypeStatus')),
            ],
            options={
                'db_table': 'goupon_backage',
            },
        ),
        migrations.CreateModel(
            name='GrouponOrder',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(db_column='CREATE_TIME')),
                ('amount', models.DecimalField(db_column='AMOUNT', decimal_places=2, max_digits=10)),
                ('settlement_time', models.DateTimeField(blank=True, db_column='SETTLEMENT_TIME', null=True)),
                ('order_type', models.CharField(blank=True, db_column='ORDER_TYPE', max_length=48, null=True)),
                ('groupon', models.ForeignKey(db_column='GROUPON_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Groupon')),
                ('member', models.ForeignKey(db_column='MEMBER_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Member')),
                ('shop', models.ForeignKey(db_column='SHOP_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Shop')),
                ('status', models.ForeignKey(db_column='STATUS_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.TypeStatus')),
            ],
            options={
                'db_table': 'groupon_order',
            },
        ),
        migrations.CreateModel(
            name='Integral',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('balance', models.IntegerField(db_column='BALANCE')),
                ('expired_date', models.DateTimeField(blank=True, db_column='EXPIRED_DATE', null=True)),
                ('member', models.ForeignKey(db_column='MEMBER_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Member')),
            ],
            options={
                'db_table': 'integral',
            },
        ),
        migrations.CreateModel(
            name='IntegralTransaction',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('amount', models.IntegerField(db_column='AMOUNT')),
                ('trx_datetime', models.DateTimeField(db_column='TRX_DATETIME')),
                ('member', models.ForeignKey(db_column='MEMBER_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Member')),
                ('shop', models.ForeignKey(db_column='SHOP_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Shop')),
                ('status', models.ForeignKey(db_column='STATUS_ID', on_delete=django.db.models.deletion.DO_NOTHING, related_name='Integraltransaction_set_of_status', to='shoppingmall_admin.TypeStatus')),
                ('trx_type', models.ForeignKey(db_column='trx_type_id', on_delete=django.db.models.deletion.DO_NOTHING, related_name='Integraltransaction_set_of_trx_type', to='shoppingmall_admin.TypeStatus')),
            ],
            options={
                'db_table': 'integral_transaction',
            },
        ),
        migrations.CreateModel(
            name='IntegralTransactionProduct',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('quantity', models.IntegerField(blank=True, db_column='QUANTITY', null=True)),
                ('integral_transaction_product_col', models.CharField(db_column='Integral_Transaction_product_col', max_length=45)),
                ('product', models.ForeignKey(db_column='PRODUCT_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Product')),
                ('transaction', models.ForeignKey(db_column='TRANSACTION_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.IntegralTransaction')),
            ],
            options={
                'db_table': 'integral_transaction_product',
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('order_datetime', models.DateTimeField(blank=True, db_column='ORDER_DATETIME', null=True)),
                ('amount', models.DecimalField(blank=True, db_column='AMOUNT', decimal_places=0, max_digits=10, null=True)),
                ('is_used_discount', models.IntegerField(blank=True, db_column='IS_USED_DISCOUNT', null=True)),
                ('discount', models.ForeignKey(db_column='DISCOUNT_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Discount')),
                ('member', models.ForeignKey(db_column='MEMBER_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Member')),
                ('order_type', models.ForeignKey(db_column='ORDER_TYPE_ID', on_delete=django.db.models.deletion.DO_NOTHING, related_name='Order_set_of_order_type', to='shoppingmall_admin.TypeStatus')),
                ('status', models.ForeignKey(db_column='STATUS_ID', on_delete=django.db.models.deletion.DO_NOTHING, related_name='Order_set_of_status', to='shoppingmall_admin.TypeStatus')),
            ],
            options={
                'db_table': 'order',
            },
        ),
        migrations.CreateModel(
            name='OrderProduct',
            fields=[
                ('id', models.CharField(db_column='ID', max_length=25, primary_key=True, serialize=False)),
                ('quantity', models.IntegerField(blank=True, db_column='QUANTITY', null=True)),
                ('order', models.ForeignKey(db_column='ORDER_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Order')),
                ('product', models.ForeignKey(db_column='PRODUCT_ID', on_delete=django.db.models.deletion.DO_NOTHING, to='shoppingmall_admin.Product')),
            ],
            options={
                'db_table': 'order_product',
            },
        ),
        migrations.AlterUniqueTogether(
            name='orderproduct',
            unique_together=set([('product', 'order')]),
        ),
        migrations.AlterUniqueTogether(
            name='integraltransactionproduct',
            unique_together=set([('product', 'transaction')]),
        ),
    ]
