Skip to content

Commit

Permalink
add index for savedrun
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Nov 12, 2023
1 parent 2aef351 commit eaececf
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 4.2.5 on 2023-11-12 15:40

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):
dependencies = [
("app_users", "0009_alter_appusertransaction_options_and_more"),
]

operations = [
migrations.AlterField(
model_name="appuser",
name="balance",
field=models.IntegerField(verbose_name="bal"),
),
migrations.AlterField(
model_name="appuser",
name="created_at",
field=models.DateTimeField(
blank=True,
default=django.utils.timezone.now,
editable=False,
verbose_name="created",
),
),
migrations.AlterField(
model_name="appuser",
name="display_name",
field=models.TextField(blank=True, verbose_name="name"),
),
migrations.AlterField(
model_name="appuser",
name="is_paying",
field=models.BooleanField(default=False, verbose_name="paid"),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.2.5 on 2023-11-12 15:40

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("bots", "0045_savedrun_transaction"),
]

operations = [
migrations.AddIndex(
model_name="savedrun",
index=models.Index(
fields=["-created_at"], name="bots_savedr_created_cb8e09_idx"
),
),
migrations.AddIndex(
model_name="savedrun",
index=models.Index(
fields=["-updated_at"], name="bots_savedr_updated_a6c854_idx"
),
),
]
2 changes: 2 additions & 0 deletions bots/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ class Meta:
),
]
indexes = [
models.Index(fields=["-created_at"]),
models.Index(fields=["-updated_at"]),
models.Index(fields=["workflow"]),
models.Index(fields=["workflow", "run_id", "uid"]),
models.Index(fields=["workflow", "example_id", "run_id", "uid"]),
Expand Down

0 comments on commit eaececf

Please sign in to comment.