Jump to content

ps_image table needs reworking guys....


MrBaseball34

Recommended Posts

Let's say I am writing a custom import routine to import my vendor's inventory. I have a function to insert the product images into the ps_image table.

Now, since you don't have a unique index on id_image id_product, position, cover, I can insert as many items as I want with the same id_product, position, cover.

This causes great problems in the LEFT JOIN with ps_image in Search class because it will return multiple products if you only have one product in ps_product but have > 1 image in ps_image.

Modifying my INSERT to use either INSERT IGNORE or ON DUPLICATE KY does not work because there would be no duplicate key if id_image is not included in any key with the other columns.

BAD architecture....Please justify to me why you don't need to rework the primary key to include ALL columns and drop
the other keys.

Although I don' t use your import process, I wonder if it would do the same thing.

I am going to use PHP in my import process to subvert this problem but you really should take a look at it.

Link to comment
Share on other sites

  • 2 weeks later...
You should post a bug report if you believe an index needs to be added to the ps_image table. The PrestaShop developers read all the bug reports, but not all the forum posts.


Ain't that the freaking truth. They care more about getting a new flawed version out than helping people with the flawed version they already released.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...