I've just tried an upgrade from Drupal 5.x to 6.x, with a corresponding upgrade to the image module. I'm ironing out a few wrinkles...
I found the {image} table was created successfully enough when I ran update.php, but the table is not populated with anything, meaning the Image module doesn't seem to know anything about the images I've already got on the system (although new uploads seem to work fine).
It's possible to populate the table; Image then rebuilds derivative images whenever any of them are viewed (but I guess an upgrade should probably do that when you run update.php?)
I'm sure there's a SQL-only way to do this, but I used the following code to populate {image}:
$result = db_query("SELECT f.fid,u.nid FROM {files} AS f JOIN {upload} AS u WHERE f.fid=u.fid AND f.filename='_original'");
while($row = db_fetch_object($result)) {
db_query("INSERT INTO {image} (nid,fid,image_size) VALUES (%d, %d, '_original')", $row->nid, $row->fid);
}
(I actually pasted the above into a page and used 'preview' to run it, but I guess it wants to be in image.install somewhere)
Given the simple select/join SQL involved, one wonders why we have got the {image} table at all - all the info in it is stored elsewhere. However, I'm not going to give anyone too much of a hard time about it ;-)
Comments
Comment #1
sandalle commentedI had a similar issue (though it was Drupal 5.9 -> Drupal 6.3) and found the solution in #257743: 6.x upgrade error: Unknown column 'f.nid' in 'field list' query.
Comment #2
jandd commentedA patch for this issue is available at http://drupal.org/node/257743#comment-967306 now.