# Generated by Django 3.0.8 on 2020-08-18 15:09

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


class Migration(migrations.Migration):

    dependencies = [
        ('auctions', '0002_bid_comments_listings'),
    ]

    operations = [
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('commentedDate', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Listing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('listingItemName', models.CharField(max_length=64)),
                ('price', models.IntegerField()),
                ('listingDate', models.DateTimeField(auto_now_add=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='listedProducts', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.RemoveField(
            model_name='listings',
            name='owner',
        ),
        migrations.AlterField(
            model_name='bid',
            name='bidDate',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.DeleteModel(
            name='comments',
        ),
        migrations.AddField(
            model_name='comment',
            name='commentedOn',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='auctions.Listing'),
        ),
        migrations.AddField(
            model_name='comment',
            name='commentor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='commentor', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='bid',
            name='biddedItemName',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bids', to='auctions.Listing'),
        ),
        migrations.DeleteModel(
            name='listings',
        ),
    ]
