# Generated by Django 6.1 on 2026-09-06 11:17 import django.db.models.deletion import uuid from decimal import Decimal from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Event', fields=[ ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('title', models.CharField(max_length=200)), ('slug', models.SlugField(max_length=220, unique=True)), ('description', models.TextField(blank=True)), ('starts_at', models.DateTimeField()), ('venue', models.CharField(blank=True, max_length=200)), ('capacity', models.PositiveIntegerField(default=0)), ('price', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=10)), ('currency', models.CharField(default='usd', max_length=8)), ('is_published', models.BooleanField(default=False)), ], options={ 'ordering': ['starts_at'], }, ), migrations.CreateModel( name='TicketOrder', fields=[ ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('number', models.CharField(max_length=32, unique=True)), ('email', models.EmailField(max_length=254)), ('customer_name', models.CharField(blank=True, max_length=200)), ('quantity', models.PositiveIntegerField(default=1)), ('amount', models.DecimalField(decimal_places=2, max_digits=10)), ('currency', models.CharField(default='usd', max_length=8)), ('status', models.CharField(choices=[('draft', 'Draft'), ('open', 'Open'), ('paid', 'Paid'), ('cancelled', 'Cancelled')], default='draft', max_length=16)), ('stripe_checkout_session_id', models.CharField(blank=True, max_length=255)), ('hosted_checkout_url', models.URLField(blank=True)), ('paid_at', models.DateTimeField(blank=True, null=True)), ('event', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ticket_orders', to='events.event')), ], options={ 'ordering': ['-created_at'], }, ), migrations.CreateModel( name='Ticket', fields=[ ('created_at', models.DateTimeField(auto_now_add=True)), ('updated_at', models.DateTimeField(auto_now=True)), ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), ('code', models.CharField(max_length=16, unique=True)), ('attendee_name', models.CharField(blank=True, max_length=200)), ('event', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tickets', to='events.event')), ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to='events.ticketorder')), ], options={ 'ordering': ['created_at'], }, ), ]