Last modified: 2014-09-25 14:58:51 UTC
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".
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]]