зеркало из https://github.com/mozilla/treeherder.git
Sync migration schemas and add summary index to the django model
This commit is contained in:
Родитель
096e26bb29
Коммит
496b4b9dfb
|
@ -22,6 +22,12 @@ if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.mysql':
|
|||
'SET max_error_count=@old_max_error_count;',
|
||||
],
|
||||
reverse_sql=['ALTER TABLE bugscache DROP INDEX idx_summary;'],
|
||||
state_operations=[
|
||||
migrations.AddIndex(
|
||||
model_name='bugscache',
|
||||
index=models.Index(fields=['summary'], name='bugscache_summary_7f6b96_idx'),
|
||||
)
|
||||
],
|
||||
),
|
||||
# Since Django doesn't natively support creating composite prefix indicies for Mysql
|
||||
migrations.RunSQL(
|
||||
|
@ -61,7 +67,8 @@ else:
|
|||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='bugscache', index=models.Index('summary', name='idx_summary')
|
||||
model_name='bugscache',
|
||||
index=models.Index(fields=['summary'], name='bugscache_summary_7f6b96_idx'),
|
||||
),
|
||||
]
|
||||
|
||||
|
|
|
@ -225,6 +225,9 @@ class Bugscache(models.Model):
|
|||
class Meta:
|
||||
db_table = 'bugscache'
|
||||
verbose_name_plural = 'bugscache'
|
||||
indexes = [
|
||||
models.Index(fields=['summary']),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
return "{0}".format(self.id)
|
||||
|
|
Загрузка…
Ссылка в новой задаче