Closed
Bug 611014
Opened 14 years ago
Closed 11 years ago
Add id columns to all tables in status db
Categories
(Release Engineering :: General, defect, P4)
Release Engineering
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: Pike, Unassigned)
Details
(Whiteboard: [statusdb])
I've managed to set up a django model set for status db.
I've hit one issue, and that is that django really likes to have id columns for any table that it creates models for, and that includes the intermediate models for many-to-many relationships.
It'd be really helpful to add those, right now, the following SQL should do it, judging from the status db export:
ALTER TABLE build_properties ADD COLUMN `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY FIRST;
ALTER TABLE build_requests ADD COLUMN `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY FIRST;
ALTER TABLE file_changes ADD COLUMN `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY FIRST;
This would open up the status db to all the django-based webdev infrastructure and momentum we have at mozilla right now.
A similar request holds for scheduler db, but I'll file that over at buildbot.net.
Updated•14 years ago
|
Whiteboard: [statusdb]
Comment 1•14 years ago
|
||
django doesn't handle many-many association tables without an id column? that seems very busted.
Reporter | ||
Comment 2•14 years ago
|
||
Some queries can really only be done effienctly by doing a query on the association table directly, which in terms of django, means instantiating the models. And for that it needs the id column, yeah. The other queries that don't try to instantiate the model work, still.
That's not really sweet, and a known bug or shortcoming, but really low on their priority list. It's easy to work around in most cases, "just add a column".
Comment 3•14 years ago
|
||
I thought django could handle compound primary keys? A many-to-many table's primary key is just the two foreign keys.
That said, the "many" side of a one-to-many table should legitimately have a primary key.
Reporter | ||
Comment 4•14 years ago
|
||
Sadly, not. http://code.djangoproject.com/ticket/373
Updated•14 years ago
|
Priority: -- → P4
Assignee | ||
Updated•11 years ago
|
Product: mozilla.org → Release Engineering
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•