error when updating to 6.x-1.x-dev
doughnut - February 18, 2008 - 13:23
| Project: | Image |
| Version: | 6.x-1.x-dev |
| Component: | image.module |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
After uploading the image module files, and attempting to run update.php, I'm presented with this error after the update process:
user warning: Table 'image' already exists query: CREATE TABLE image ( `nid` INTEGER UNSIGNED NOT NULL, `fid` INTEGER UNSIGNED NOT NULL, `image_size` VARCHAR(32) NOT NULL, PRIMARY KEY (`nid`, `image_size`), INDEX image_fid(`fid`) ) /*!40100 DEFAULT CHARACTER SET utf8 */; in /home/.normie/doughnut/tunhguod.com/sites/all/modules/image/image.install on line 237.
user warning: Unknown column 'f.nid' in 'field list' query: INSERT INTO image SELECT DISTINCT f.nid, f.fid, f.filename FROM files f INNER JOIN node n ON f.nid = n.nid WHERE n.type='image' AND f.filename IN ('_original', 'thumbnail', 'preview') in /home/.normie/doughnut/tunhguod.com/sites/all/modules/image/image.install on line 252.
user warning: Table 'tunhguod.file_revisions' doesn't exist query: DELETE FROM file_revisions WHERE EXISTS (SELECT * FROM image WHERE image.fid = file_revisions.fid) in /home/.normie/doughnut/tunhguod.com/sites/all/modules/image/image.install on line 255.Any suggestions on how I can get the image module updated? It's a big part of my site.

#1
No fix, but I too ran in to the same problem, upgrading from 5.x to 6.1:
Update #5200
* CREATE TABLE {image} ( `nid` INTEGER UNSIGNED NOT NULL, `fid` INTEGER UNSIGNED NOT NULL, `image_size` VARCHAR(32) NOT NULL, PRIMARY KEY (`nid`, `image_size`), INDEX image_fid(`fid`) ) /*!40100 DEFAULT CHARACTER SET utf8 */;
* Failed: INSERT INTO {image} SELECT DISTINCT f.nid, f.fid, f.filename FROM {files} f INNER JOIN {node} n ON f.nid = n.nid WHERE n.type='image' AND f.filename IN ('_original', 'thumbnail', 'preview')
* Failed: DELETE FROM {file_revisions} WHERE EXISTS (SELECT * FROM {image} WHERE {image}.fid = {file_revisions}.fid)
The warnings shown:
* user warning: Unknown column 'f.nid' in 'field list' query: INSERT INTO image SELECT DISTINCT f.nid, f.fid, f.filename FROM files f INNER JOIN node n ON f.nid = n.nid WHERE n.type='image' AND f.filename IN ('_original', 'thumbnail', 'preview') in /.../sites/all/modules/image/image.install on line 252.
* user warning: Table 'drpl.file_revisions' doesn't exist query: DELETE FROM file_revisions WHERE EXISTS (SELECT * FROM image WHERE image.fid = file_revisions.fid) in /.../sites/all/modules/image/image.install on line 255.
#2
This issue is caused by the upgrade procedure deleting the nid field files table before the image module update has a chance to get to it. I spent most of this weekend working this out. What you need to do (make sure you have a database backup) is to get ready for the upgrade to 6.1 then when you run update.php, click on the select versions button and set all of the modules to 'No updates available' except for image module. You will get lots of errors but now you can run update.php again but this time you need to go and select the earliest version 6 update for all modules except image.
I hosed two of my sites because I didn't keep an backup of the database and the update script killed off the field. I can probably rebuild the image table myself but it won't be much fun. If I work out a script to do it I'll post it here.
Good luck
#3
I did this which seems to create the right stuff in image for me.
#4
Marking as duplicate of #357793: Problem after upgrade