Skip to content

Commit

Permalink
add index to org slug field
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham4401 committed Aug 1, 2024
1 parent fa463a8 commit 033d911
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Generated by Django 5.0.7 on 2024-08-01 19:39
# Generated by Django 5.0.7 on 2024-08-01 21:13

import django_extensions.db.fields
from django.db import migrations
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('org', '0002_alter_orggroupobjectpermission_content_object_and_more'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
Expand All @@ -16,4 +18,8 @@ class Migration(migrations.Migration):
name='slug',
field=django_extensions.db.fields.AutoSlugField(blank=True, editable=False, populate_from='name'),
),
migrations.AddIndex(
model_name='org',
index=models.Index(fields=['slug'], name='org_slug_idx'),
),
]
1 change: 1 addition & 0 deletions server/org/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Meta:
verbose_name = "Organization"
verbose_name_plural = "Organizations"
ordering = ["name"]
indexes = [models.Index(fields=["slug"], name="org_slug_idx")]

id = models.UUIDField(
unique=True,
Expand Down

0 comments on commit 033d911

Please sign in to comment.