0001_initial.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Generated by Django 4.1.2 on 2022-12-18 16:08
  2. import datetime
  3. from django.conf import settings
  4. from django.db import migrations, models
  5. import django.db.models.deletion
  6. import zitap.models
  7. class Migration(migrations.Migration):
  8. initial = True
  9. dependencies = [
  10. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  11. ]
  12. operations = [
  13. migrations.CreateModel(
  14. name='Event',
  15. fields=[
  16. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  17. ('url', models.CharField(default=zitap.models.generate_random_url, max_length=6, unique=True)),
  18. ('name', models.CharField(max_length=255)),
  19. ('slot_interval', models.DurationField(default=datetime.timedelta(seconds=900))),
  20. ('created_at', models.DateTimeField(auto_now_add=True)),
  21. ('start_time', models.TimeField(default='09:00')),
  22. ('end_time', models.TimeField(default='20:00')),
  23. ],
  24. ),
  25. migrations.CreateModel(
  26. name='Participant',
  27. fields=[
  28. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  29. ('slots', models.BinaryField()),
  30. ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zitap.event')),
  31. ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
  32. ],
  33. ),
  34. migrations.CreateModel(
  35. name='Date',
  36. fields=[
  37. ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  38. ('date', models.DateField()),
  39. ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zitap.event')),
  40. ],
  41. ),
  42. ]