Jump to content

[RESOLVED] Repair Database Table?


TDLWebs

Recommended Posts

After my issues with missing images 

 

I had to restore the CubeCart_filemanager table in the database by merging two backup files. However, this has created duplicate entries with the result that there is no primary key etc. Images can no longer be allocated to products in admin.

I have located the duplicates using the query:

SELECT filename, COUNT(filename) FROM CubeCart_filemanager GROUP BY filename HAVING COUNT(filename) > 1;

But some images are used twice; once by a product and once by a category - as seen when I search for a particular image filename which is duplicated (see db-image1.jpg below)

db-image1.thumb.jpg.4da6432f459ad090eb2c99dfa678621a.jpg

They also have identical md5hash entries.

The phpmyadmin screenshot taken from a healthy CubeCart_filemanager table should have the structure seen in db-image2.jpg below:

db-image2.jpg.08c0a3bfcd27a1e0432985f1d9bd40a7.jpg

Any idea how can I remove the unnecessary duplicates and restore the integrity of the CubeCart_filemanager table????

Link to comment
Share on other sites

On 12/6/2019 at 7:15 PM, bsmither said:

Having duplicate primary values seems to suggest that two backups of that one table was used, when only the latest should have been used.

Yes, that's it. My stupid error. I was concerned at losing the latest product details which had been added since and tried to be clever but failed miserably.

Thanks again for your expert advice bsmither!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...