Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1278711 - Add unique_together index for job_detail (#1667)
- Loading branch information
camd
committed
Aug 8, 2016
1 parent
54abbd4
commit 13943f6
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
treeherder/model/migrations/0036_job_details_unique_together.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('model', '0035_job_detail_field_lengths_decrease'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
# Using ALTER IGNORE so that it will automatically delete duplicates | ||
("ALTER IGNORE TABLE `job_detail` ADD CONSTRAINT " | ||
"`job_detail_title_11a9e7f847f5214c_uniq` " | ||
"UNIQUE (`title`, `value`, `job_id`);"), | ||
state_operations=[ | ||
migrations.AlterUniqueTogether( | ||
name='jobdetail', | ||
unique_together=set([('title', 'value', 'job')]), | ||
), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters