Page MenuHomePhabricator

Image and oldimage tables lack auto-incrementing primary keys
Closed, DuplicatePublic


Image and oldimage tables lack primary keys. Therefore, img_id and oi_id should be added. There is a comment in LocalFile::recordUpload2() noting, "# TODO: the image/oldimage tables should be like page/revision with an ID field".

Version: 1.25-git
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 3:50 AM
bzimport set Reference to bz71198.

Oh, I guess image has a primary key (img_name), but it should be an auto-incrementing primary key.

Aaron, I notice you were the one who added that TODO. What did you have in mind, adding an img_id field and an oi_img_id field? So then, an image entry with img_id 1 that gets moved to the oldimage table (due to an upload of a new version of the file) would then have oi_img_id 1?

Or did you have in mind a system in which image would be like the page table, which stores no revision data, and only links to the latest revision; and oldimage would be like the revision table, which contains the data about where to find the text? So then oi_img_id would be like rev_page, and there would be an img_latest, rather than having an img_name that stores filenames? Thanks.

Filed RFC as [[mw:Requests for comment/Image and oldimage tables]]