# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-01 02:30
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('app', '0091_wallet_test_data_fixtime'),
    ]

    operations = [
        migrations.CreateModel(
            name='Withdrawal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.PositiveIntegerField()),
                ('status', models.CharField(choices=[('u', '待审核'), ('a', '已通过'), ('r', '已驳回')], default='u', max_length=2)),
                ('submit_time', models.DateTimeField(auto_now_add=True)),
                ('audit_at', models.DateTimeField(blank=True, null=True)),
                ('comment', models.CharField(blank=True, max_length=100, null=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Account')),
                ('audit_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('bankcard', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.BankCard')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterField(
            model_name='accounthistory',
            name='bankcard',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.BankCard'),
        ),
        migrations.AddField(
            model_name='accounthistory',
            name='timeslot',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.TimeSlot'),
        ),
        migrations.AddField(
            model_name='accounthistory',
            name='withdrawal',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.Withdrawal'),
        ),
    ]
