# Generated by Django 3.1.5 on 2021-01-29 15:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BidItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_id', models.CharField(max_length=50)),
                ('token_threshold', models.PositiveIntegerField(default=1000)),
                ('release_date', models.DateField()),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('original_price', models.PositiveIntegerField()),
                ('discount_price', models.PositiveIntegerField()),
                ('image_url', models.URLField()),
            ],
        ),
        migrations.CreateModel(
            name='Shop',
            fields=[
                ('shop_id', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('accumulate_token', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('user_id', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('token', models.PositiveIntegerField(default=1000)),
            ],
        ),
        migrations.CreateModel(
            name='BidTransaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token_bid', models.PositiveIntegerField()),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bidapp.biditem')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bidapp.user')),
            ],
        ),
        migrations.AddField(
            model_name='biditem',
            name='shop',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bidapp.shop'),
        ),
        migrations.AddField(
            model_name='biditem',
            name='winner',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bidapp.user'),
        ),
    ]
