Closed Bug 1226651 Opened 9 years ago Closed 9 years ago

Several reference data tables are missing composite unique keys after bug 1193836

Categories

(Tree Management :: Treeherder, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(4 files)

The template SQL files for the reference data tables were removed, since we're now using the Django model to create the tables instead: https://github.com/mozilla/treeherder/commit/0f3788036290146d99df76dea73edbebaa2b1aab However in the template files the following had composite unique keys, which aren't in the model: * reference_data_signatures * job_group * user_exclusion_profile Also the exclusion_profile_exclusions table doesn't exist in the model at all, when it was in the template SQL. Is this expected?
Attached patch Schema diffSplinter Review
I performed a `mysqldump -d -u root treeherder` on the revisions mentioned above, then on the new schema file tweaked it in cases where differences were just ordering or auto-index naming. This is the diff -U8 of the resultant files. Mauro, apart from the `unique_together`s, is there anything else that you can see that needs changing?
Flags: needinfo?(mdoglio)
I'd recommend viewing the diff locally in an editor with syntax highlighting; the split diff view on native bugzilla and also splinter is really less than ideal for this use case :-)
The exclusion_profile_exclusions table is generated from the ManyToManyField defined in [1]. For more info see [2] [1] https://github.com/mozilla/treeherder/blob/9c7f7ff08a76b49b9812035ffc0b04ab45e29180/treeherder/model/models.py#L409 [2] https://docs.djangoproject.com/en/1.8/ref/models/fields/#id1
Flags: needinfo?(mdoglio)
(In reply to Mauro Doglio [:mdoglio] from comment #7) > there are also a couple of indexes missing: > https://gist.github.com/edmorley/78270fbad7d8cd48a3c2#file-bug1226651-diff- > L139 > https://gist.github.com/edmorley/78270fbad7d8cd48a3c2#file-bug1226651-diff- > L273 Those two have equivalent unique keys, so were actually doubled up before.
Assignee: nobody → emorley
Attachment #8691635 - Flags: review?(mdoglio)
Attachment #8691635 - Flags: review?(mdoglio) → review+
Commit pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/998f4d374d7be843bf25ec449cc4d19752601836 Bug 1226651 - Add missing unique_together model constraints These were present in the raw SQL used prior to bug 1193836, so should already exist on stage/prod/heroku. As such, I've added these to the initial migration to avoid errors during migrate/having to use `--fake`.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: