diff --git a/aiarena/core/migrations/0071_auto_20231017_0957.py b/aiarena/core/migrations/0071_auto_20231017_0957.py new file mode 100644 index 00000000..e4e1b5f8 --- /dev/null +++ b/aiarena/core/migrations/0071_auto_20231017_0957.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.16 on 2023-10-17 09:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0070_competition_indepth_bot_statistics_enabled'), + ] + + operations = [ + migrations.AlterField( + model_name='matchparticipation', + name='participant_number', + field=models.PositiveSmallIntegerField(db_index=True), + ), + migrations.AlterField( + model_name='news', + name='created', + field=models.DateTimeField(auto_now_add=True, db_index=True), + ), + ] diff --git a/aiarena/core/models/match_participation.py b/aiarena/core/models/match_participation.py index 7d20d87c..12ac28ab 100644 --- a/aiarena/core/models/match_participation.py +++ b/aiarena/core/models/match_participation.py @@ -33,7 +33,7 @@ class MatchParticipation(models.Model, LockableModelMixin): ) match = models.ForeignKey(Match, on_delete=models.CASCADE) - participant_number = models.PositiveSmallIntegerField() + participant_number = models.PositiveSmallIntegerField(db_index=True) bot = models.ForeignKey(Bot, on_delete=models.PROTECT) starting_elo = models.SmallIntegerField(null=True) """The bot's ELO at the time the match started diff --git a/aiarena/core/models/news.py b/aiarena/core/models/news.py index 28e2db3c..1d0acc3e 100644 --- a/aiarena/core/models/news.py +++ b/aiarena/core/models/news.py @@ -6,7 +6,7 @@ class News(models.Model): - created = models.DateTimeField(auto_now_add=True) + created = models.DateTimeField(auto_now_add=True, db_index=True) title = models.TextField(max_length=40, blank=True, null=True) text = models.TextField(max_length=500, blank=False, null=False) yt_link = models.URLField(blank=True, null=True)