...
This commit is contained in:
parent
31f2ed70ff
commit
c0cb1ab73e
2 changed files with 7 additions and 7 deletions
|
|
@ -42,12 +42,12 @@ ALTER TABLE archive_components RENAME archive_id TO component_id;
|
|||
ALTER TABLE archive_components RENAME image_id TO archive_id;
|
||||
|
||||
SELECT statement_timestamp(), 'Fixing up component tables, adding constraints' as msg;
|
||||
ALTER TABLE archive_rpm_components ADD CONSTRAINT archive_fk FOREIGN KEY (archive_id) REFERENCES archiveinfo(id);
|
||||
ALTER TABLE archive_rpm_components ADD CONSTRAINT rpm_fk FOREIGN KEY (rpm_id) REFERENCES rpminfo(id);
|
||||
ALTER TABLE archive_rpm_components ADD CONSTRAINT arcomp_unique UNIQUE (archive_id, rpm_id);
|
||||
ALTER TABLE archive_components ADD CONSTRAINT archive_fk FOREIGN KEY (archive_id) REFERENCES archiveinfo(id);
|
||||
ALTER TABLE archive_components ADD CONSTRAINT rpm_fk FOREIGN KEY (component_id) REFERENCES archiveinfo(id);
|
||||
ALTER TABLE archive_components ADD CONSTRAINT arcomp_unique UNIQUE (archive_id, component_id);
|
||||
ALTER TABLE archive_rpm_components ADD CONSTRAINT archive_rpm_components_archive_fk FOREIGN KEY (archive_id) REFERENCES archiveinfo(id);
|
||||
ALTER TABLE archive_rpm_components ADD CONSTRAINT archive_rpm_components_rpm_fk FOREIGN KEY (rpm_id) REFERENCES rpminfo(id);
|
||||
ALTER TABLE archive_rpm_components ADD CONSTRAINT archive_rpm_components_unique UNIQUE (archive_id, rpm_id);
|
||||
ALTER TABLE archive_components ADD CONSTRAINT archive_components_archive_fk FOREIGN KEY (archive_id) REFERENCES archiveinfo(id);
|
||||
ALTER TABLE archive_components ADD CONSTRAINT archive_components_rpm_fk FOREIGN KEY (component_id) REFERENCES archiveinfo(id);
|
||||
ALTER TABLE archive_components ADD CONSTRAINT archive_components_unique UNIQUE (archive_id, component_id);
|
||||
|
||||
SELECT statement_timestamp(), 'Adding component table indexes' as msg;
|
||||
CREATE INDEX rpm_components_idx on archive_rpm_components(rpm_id);
|
||||
|
|
|
|||
|
|
@ -6527,7 +6527,7 @@ def build_references(build_id, limit=None):
|
|||
break
|
||||
ret['rpms'] = idx.values()
|
||||
|
||||
ret['images'] = []
|
||||
ret['component_of'] = []
|
||||
# find images/archives that contain the build rpms
|
||||
fields = ['archive_id']
|
||||
clauses = ['archive_rpm_components.rpm_id = %(rpm_id)s']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue