# Generated by Django 2.0 on 2021-05-11 09:13

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),
        ('barter', '0004_auto_20210418_1533'),
    ]

    operations = [
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.SmallIntegerField(choices=[(0, '待查阅'), (1, '失败'), (2, '成功')], default=0, verbose_name='状态')),
                ('isDelete', models.BooleanField(default=False, verbose_name='是否删除')),
            ],
            options={
                'verbose_name': '交易记录表',
                'verbose_name_plural': '交易记录表',
            },
        ),
        migrations.AlterModelOptions(
            name='barter',
            options={'ordering': ['-created_time'], 'verbose_name': '换品', 'verbose_name_plural': '换品'},
        ),
        migrations.AlterField(
            model_name='barter',
            name='image',
            field=models.ImageField(blank=True, null=True, upload_to='barter/%Y%m%d/', verbose_name='换品图片'),
        ),
        migrations.AddField(
            model_name='application',
            name='buy_barter',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='buy_barter', to='barter.Barter'),
        ),
        migrations.AddField(
            model_name='application',
            name='buyer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='buyer', to=settings.AUTH_USER_MODEL, verbose_name='买家'),
        ),
        migrations.AddField(
            model_name='application',
            name='sell_barter',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sell_barter', to='barter.Barter'),
        ),
        migrations.AddField(
            model_name='application',
            name='seller',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='seller', to=settings.AUTH_USER_MODEL, verbose_name='卖家'),
        ),
    ]
