bakko88 Posted March 9, 2021 Share Posted March 9, 2021 Hi, I'm trying to manually update my prestashop from 1.6 to 1.7 (1 click upgrade gives me an error) I managed to do almost everything but some things give me error. This table and others: ps_product_attribute_shop They have an attribute that I cannot edit (I leave the images) The only way I would have is to edit the version 1.7 file to "NO" But if I do this and then transfer the files I get this error ( image 3 ) Can you help me? Link to comment Share on other sites More sharing options...
musicmaster Posted March 10, 2021 Share Posted March 10, 2021 It looks like you are coming from 1.6.0. There is a difference between PS 1.6.0 and 1.6.1 in the way 1-out-of-many situations like the cover image and the default attribute are handled. In 1.6.0 the default/cover has a value of 1 and all the others have a value of 0 (zero). In 1.6.1 this is 1 and NULL. In addition 1.6.1 puts an unique index on those fields. That is supposed both to be an optimization and preventing more than one 1 value. Note that if you put such a unique index on a 1.6.0 database you will get an error because there is more than one zero. NULL values don't give this problem. This transition creates sometimes a problem when there is a product with more than one 1. In that case your upgrade will fail. It looks like you have such a case of data pollution. If you look good at the error popup you will see that it is for an id_product with value 0. Such a value shouldn't exist. 1 Link to comment Share on other sites More sharing options...
bakko88 Posted March 10, 2021 Author Share Posted March 10, 2021 4 hours ago, musicmaster said: It looks like you are coming from 1.6.0. There is a difference between PS 1.6.0 and 1.6.1 in the way 1-out-of-many situations like the cover image and the default attribute are handled. In 1.6.0 the default/cover has a value of 1 and all the others have a value of 0 (zero). In 1.6.1 this is 1 and NULL. In addition 1.6.1 puts an unique index on those fields. That is supposed both to be an optimization and preventing more than one 1 value. Note that if you put such a unique index on a 1.6.0 database you will get an error because there is more than one zero. NULL values don't give this problem. This transition creates sometimes a problem when there is a product with more than one 1. In that case your upgrade will fail. It looks like you have such a case of data pollution. If you look good at the error popup you will see that it is for an id_product with value 0. Such a value shouldn't exist. Thanks, in fact I noticed that the main problem is that in version 1.6 there is no id_product and therefore combinations are not assigned to the product. That string is in the ps_product_attribute table, is there any way to just move that string? Link to comment Share on other sites More sharing options...
musicmaster Posted March 10, 2021 Share Posted March 10, 2021 (edited) From the top of my head - so make a backup: Update ps_product_attribute p, ps_product_attribute_shop ps SET ps.id_product=p.id_product WHERE ps.id_product_attribute=p.id_product_attribute. Edited March 10, 2021 by musicmaster (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now