48 lines
2.1 KiB
Python
48 lines
2.1 KiB
Python
# Generated by Django 5.2.7 on 2026-02-12 16:44
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='CarAuction',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=200)),
|
|
('make', models.CharField(max_length=100)),
|
|
('model', models.CharField(max_length=100)),
|
|
('year', models.IntegerField()),
|
|
('description', models.TextField()),
|
|
('image_url', models.URLField(blank=True, max_length=500, null=True)),
|
|
('starting_bid', models.DecimalField(decimal_places=2, max_digits=10)),
|
|
('current_bid', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('end_date', models.DateTimeField()),
|
|
('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='auctions', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Bid',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('amount', models.DecimalField(decimal_places=2, max_digits=10)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
('auction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bids', to='core.carauction')),
|
|
],
|
|
options={
|
|
'ordering': ['-amount'],
|
|
},
|
|
),
|
|
]
|