Zen Cart Logo
Forums / General Questions / Why is products_description.products_id an auto-increment field?

Why is products_description.products_id an auto-increment field?

Views: 4,554

Results 1 to 5 of 5
12 Jan 2016, 4:31 PM
#1
lat9 avatar

lat9

Administrator

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

Why is products_description.products_id an auto-increment field?

Given that the products_description table's products_id field is always updated directly with the products_id value from the associated *products *table, why is the products_description.products_id field tagged with an auto-increment attribute in the database?

No issues here, just trying to learn/understand.

12 Jan 2016, 5:22 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Why is products_description.products_id an auto-increment field?

I've always wondered the same.

And, I thought we'd addressed that awhile back ... but evidently we haven't. Not even in the v160 code. Argh.

Maybe we can convince wilt to allow that change for v155 ;)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Jan 2016, 5:53 PM
#3
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,904
Plugin Contributions:
3

Re: Why is products_description.products_id an auto-increment field?

There is absolutely no reason it needs to be auto_increment.

I took a look at a v1.0 zip and it's set as auto_increment there, so this is something that has not just crept into code !!!

As far as I know there are no potential bad side effects from having it set thus, apart from some side cases related to innodb.

12 Jan 2016, 6:29 PM
#4
lat9 avatar

lat9

Administrator

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

Re: Why is products_description.products_id an auto-increment field?

Thanks for the updates and answers! I guess that this underscores that it's OK to ask questions.:P

12 Jan 2016, 7:59 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Why is products_description.products_id an auto-increment field?

The change will be included in v155.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.