Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / products_options, products_options_values: Indexes aren't auto-increment?

products_options, products_options_values: Indexes aren't auto-increment?

Views: 581

Results 1 to 4 of 4
23 Oct 2015, 2:29 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

products_options, products_options_values: Indexes aren't auto-increment?

I was surprised :ohmy: to find that the primary index for the subject database tables aren't auto-increment! Is/was there a reason for this?

23 Oct 2015, 3:54 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: products_options, products_options_values: Indexes aren't auto-increment?

lat9:

I was surprised :ohmy: to find that the primary index for the subject database tables aren't auto-increment! Is/was there a reason for this?

From what I see in review of the products_options and products_options_values tables is that the primary key is a combination of fields (products_options_id or products_options_values_id combined with the language_id) rather than a single unique field (such as an autonumber) thus more than one occurrence of each products_options_id (or products_options_values_id) can exist in the table but in different languages within the table...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

23 Oct 2015, 5:14 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: products_options, products_options_values: Indexes aren't auto-increment?

Big fat duh :blush: on my part; thanks for the update!

23 Oct 2015, 7:28 PM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: products_options, products_options_values: Indexes aren't auto-increment?

lat9:

Big fat duh :blush: on my part; thanks for the update!

No problemo, and makes sense to have expected an autonumber based on perspective and potential expectation... (Reviewing/writing code and thinking it should easily work one way to find it doesn't... ) :)

It's Friday, you get a break. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...