diff --git a/core/play/migrations/0002_alter_quizgame_join_code.py b/core/play/migrations/0002_alter_quizgame_join_code.py new file mode 100644 index 0000000..388daea --- /dev/null +++ b/core/play/migrations/0002_alter_quizgame_join_code.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.7 on 2025-03-15 13:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('play', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='quizgame', + name='join_code', + field=models.CharField(blank=True, max_length=6, unique=True), + ), + ] diff --git a/core/play/models.py b/core/play/models.py index ce16a5d..b4e16f0 100644 --- a/core/play/models.py +++ b/core/play/models.py @@ -6,7 +6,7 @@ import random, string # Create your models here. class QuizGame(models.Model): host_user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='host_user') - join_code = models.CharField(max_length=6, unique=True) + join_code = models.CharField(max_length=6, unique=True, blank=True) quiz_id = models.ForeignKey(QivipQuiz, on_delete=models.CASCADE) def save(self, *args, **kwargs):