Skip to content

Commit

Permalink
fix: indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
pomegranited committed Jul 24, 2023
1 parent 5cc1c0e commit 9a9e038
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
35 changes: 17 additions & 18 deletions openedx_tagging/core/tagging/migrations/0004_auto_20230723_2001.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
# Generated by Django 3.2.19 on 2023-07-24 01:01
# Generated by Django 3.2.19 on 2023-07-24 06:25

from django.db import migrations, models
import openedx_learning.lib.fields


class Migration(migrations.Migration):

dependencies = [
('oel_tagging', '0003_auto_20230721_1238'),
("oel_tagging", "0003_auto_20230721_1238"),
]

operations = [
migrations.RemoveIndex(
model_name='tag',
name='oel_tagging_taxonom_89e779_idx',
),
migrations.RemoveIndex(
model_name='tag',
name='oel_tagging_taxonom_44e355_idx',
),
migrations.AlterField(
model_name='objecttag',
name='object_id',
field=openedx_learning.lib.fields.MultiCollationCharField(db_collations={'mysql': 'utf8mb4_unicode_ci', 'sqlite': 'NOCASE'}, db_index=True, editable=False, help_text='Identifier for the object being tagged', max_length=255),
model_name="objecttag",
name="object_id",
field=openedx_learning.lib.fields.MultiCollationCharField(
db_collations={"mysql": "utf8mb4_unicode_ci", "sqlite": "NOCASE"},
db_index=True,
editable=False,
help_text="Identifier for the object being tagged",
max_length=255,
),
),
migrations.AlterUniqueTogether(
name='tag',
unique_together={('taxonomy', 'value'), ('taxonomy', 'external_id')},
name="tag",
unique_together={("taxonomy", "external_id"), ("taxonomy", "value")},
),
migrations.AddIndex(
model_name='objecttag',
index=models.Index(fields=['taxonomy', 'object_id'], name='oel_tagging_taxonom_aa24e6_idx'),
model_name="objecttag",
index=models.Index(
fields=["taxonomy", "object_id"], name="oel_tagging_taxonom_aa24e6_idx"
),
),
]
4 changes: 4 additions & 0 deletions openedx_tagging/core/tagging/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class Tag(models.Model):
)

class Meta:
indexes = [
models.Index(fields=["taxonomy", "value"]),
models.Index(fields=["taxonomy", "external_id"]),
]
unique_together = [
["taxonomy", "external_id"],
["taxonomy", "value"],
Expand Down

0 comments on commit 9a9e038

Please sign in to comment.