add index for models
This commit is contained in:
19
submission/migrations/0004_submission_problem_user_idx.py
Normal file
19
submission/migrations/0004_submission_problem_user_idx.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 6.0 on 2026-04-23 20:07
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('contest', '0003_acmcontestrank_acm_rank_contest_user_idx_and_more'),
|
||||
('problem', '0007_problem_problem_visible_idx'),
|
||||
('submission', '0003_add_contest_create_time_idx'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddIndex(
|
||||
model_name='submission',
|
||||
index=models.Index(fields=['problem_id', 'user_id'], name='problem_user_idx'),
|
||||
),
|
||||
]
|
||||
@@ -64,6 +64,9 @@ class Submission(models.Model):
|
||||
models.Index(
|
||||
fields=["contest_id", "-create_time"], name="contest_create_time_idx"
|
||||
),
|
||||
models.Index(
|
||||
fields=["problem_id", "user_id"], name="problem_user_idx"
|
||||
),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user