Claudia Posted July 14 Share Posted July 14 Got this in admin / maintenance in orange Cubecart_filemanager.md5hash has no key set. Expecting UNIQUE KEY. What should I do? Thanks, Claudia Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted July 14 Share Posted July 14 There's been a bit of a debate as to whether it needs to be a unique key or normal key. Either will be fine. Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 14 Author Share Posted July 14 Thanks Al Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 14 Share Posted July 14 (edited) CubeCart's admin, Maintenance has a hard-coded list of what CubeCart expects the database structure (its "schema") to look like. That hard-coded list has Cubecart_filemanager.md5hash having a UNIQUE KEY index. So, to quiet the orange warning, the database table CubeCart_filemanager should have a matching UNIQUE KEY index applied against the 'md5hash' column. Applying any other kind of index will not quiet the orange warning. Edited July 14 by bsmither Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 14 Share Posted July 14 It is strange that Cubecart_filemanager.md5hash (of your installed database) has no index currently assigned to it. The upgrade sequence against the database added a UNIQUE index to this column at the CC654 version. Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 14 Author Share Posted July 14 how would i add the unique key? Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 14 Share Posted July 14 In admin, Maintenance, Query Database (Advanced) tab, in the Query Box, enter: ALTER TABLE `CubeCart_filemanager` ADD UNIQUE(`md5hash`); #EOQ Then click the Go button. There will be no response shown. Let us also take a look at admin, Maintenance, Upgrade tab. What is the highest version shown (should be the top-most line of the History table)? Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted July 14 Share Posted July 14 That can fail. I've seen many stores with duplicate images with different names. So long as the images actually are unique it will work. This opens the debate as to whether duplication should be allowed or not. Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 14 Share Posted July 14 Indeed. I wonder if that is the case with Claudia - the upgrade at CC654 failed to execute that statement in the SQL upgrade file because the database found duplicate MD5 hashes? (I need to remind myself what sort of error reporting is shown after an upgrade for errors triggered during an upgrade.) Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 15 Author Share Posted July 15 I went from 6.5.3 to 6.5.5 Skipped 6.5.4 Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 15 Share Posted July 15 Probably not, unless you installed CC655 somewhere (other than actually upgrading CubeCart to CC655), then editing the includes/global.inc.php file to point to the existing database. If you did, in fact, run the CC655 setup (upgrade) script, CubeCart would have seen the current database schema was at CC653, which would have caused the execution of all the SQL statements in /setup/db/upgrade/6.5.4.sql and 6.5.5.sql. Depending on the above, please determine if the SQL statements in these two files need to be sent to the database. Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 16 Author Share Posted July 16 I ran your query: ALTER TABLE `CubeCart_filemanager` ADD UNIQUE(`md5hash`); #EOQ but it wouldn't take it saying something like it was already UNIQUE I din't change anything in the global file - just changed the admin folder and file to match the global names Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted July 16 Share Posted July 16 In this case make it a standard key instead.. ALTER TABLE `CubeCart_filemanager` ADD KEY(`md5hash`); #EOQ Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 16 Author Share Posted July 16 I did the above , cleared cache, and I still get the orange error Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 16 Share Posted July 16 (edited) MySQL (and by extension, MariaDB) can have more than one index, of various types, applied against a specified column, as long as they are named differently. For example, I just ADDed a KEY index to CubeCart_filemanager, 'md5hash' column, but named the KEY index "Index6" (being the sixth index applied). Following the program flow of maintenance.index.inc.php, near lines 987-1003, the loop will find the 'Non_unique'=='0' on 'md5hash' first, but then will find else 'KEY' on 'md5hash' on a subsequent iteration of the loop. So, the listing of tables will flag CubeCart_filemanager as having KEY (not named "md5hash") but expecting UNIQUE KEY -- even though there is, in fact, a UNIQUE KEY on 'md5hash'. Maybe this database needs to be looked at using an external database utility to discover what indexes are actually on CubeCart_filemanager. Edited July 17 by bsmither Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 16 Author Share Posted July 16 Could I just reinstall, or install in my case, 6.5.4 then install 6.5.5? Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 17 Share Posted July 17 We are getting into the weeds with this analysis. The original post said there was an orange banner. That is absolutely nothing to worry about. Let's wait for CC656. Quote Link to comment Share on other sites More sharing options...
Claudia Posted July 17 Author Share Posted July 17 Righto ... I'll let it go Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.