add index for models
This commit is contained in:
20
problem/migrations/0007_problem_problem_visible_idx.py
Normal file
20
problem/migrations/0007_problem_problem_visible_idx.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 6.0 on 2026-04-23 20:07
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contest', '0003_acmcontestrank_acm_rank_contest_user_idx_and_more'),
|
||||
('problem', '0006_problem_problem_contest_visible_idx'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddIndex(
|
||||
model_name='problem',
|
||||
index=models.Index(fields=['visible'], name='problem_visible_idx'),
|
||||
),
|
||||
]
|
||||
@@ -95,6 +95,7 @@ class Problem(models.Model):
|
||||
ordering = ("create_time",)
|
||||
indexes = [
|
||||
models.Index(fields=["contest", "visible"], name="problem_contest_visible_idx"),
|
||||
models.Index(fields=["visible"], name="problem_visible_idx"),
|
||||
]
|
||||
|
||||
def add_submission_number(self):
|
||||
|
||||
Reference in New Issue
Block a user