Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1278711 - Job detail unique together idx #1667

Merged
merged 1 commit into from Aug 8, 2016

Conversation

camd
Copy link
Contributor

@camd camd commented Jul 9, 2016

This one piggy-backs on the previous PR for bug 1278711, so it is in the same branch. So please just compare using the latest commit.


This change is Reviewable

operations = [
migrations.RunSQL(
# Using ALTER IGNORE so that it will automatically delete duplicates
("ALTER IGNORE TABLE `job_detail` ADD CONSTRAINT "
Copy link
Contributor Author

@camd camd Jul 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be deleting duplicates with a manual SQL command, but this is a fallback in case there are any new that arrived between cleaning and running this migration. Or if people have dupes on their local machine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely the sort of thing that you're going to want to run manually on prod, then fake the migration :)

@camd camd changed the title Job detail unique together idx Bug 1278711 - Job detail unique together idx Jul 9, 2016
@@ -615,6 +615,7 @@ class JobDetail(models.Model):

class Meta:
db_table = "job_detail"
unique_together = ["title", "value", "job"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ("title", "value", "job") syntax gives a better hint that this is a single group, though there is no functional difference.

@camd camd force-pushed the job_detail_unique_together_idx branch from 77110fd to ebed5f8 Compare July 11, 2016 23:46
@camd camd force-pushed the job_detail_unique_together_idx branch from ebed5f8 to 336dd34 Compare August 5, 2016 22:20
@camd camd merged commit 13943f6 into master Aug 8, 2016
@edmorley edmorley deleted the job_detail_unique_together_idx branch August 9, 2016 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants