Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

problem with 0519 snapshot


sgflowers

Recommended Posts

Hello,

 

upgrading to cvs 0519

 

I have an issue with the 0519 snapshot as ther is a primary index on the

address_book_id in the adress_book table when i try to change it so that the indexes match it i get an error

 

here is the index currently:

 

Keyname Type Cardinality Action Field

PRIMARY PRIMARY 522 Drop Edit address_book_id

customers_id

idx_address_book_customers_id INDEX 522 Drop Edit customers_id

 

 

error:

 

ALTER TABLE `address_book` DROP PRIMARY KEY ,

ADD PRIMARY KEY ( `address_book_id` )

 

MySQL said:

 

 

Duplicate entry '1' for key 1

 

can anyone help i am trying to use phpmyadmin to match the latest cvs i think it is because it switched between address_book_id being autoincrement and not

 

but my knowledge of how indexes work is very limited

Link to comment
Share on other sites

# Table structure for table `address_book`

#

 

 

CREATE TABLE address_book (

customers_id int(11) NOT NULL default '0',

address_book_id int(11) NOT NULL default '1',

entry_gender char(1) NOT NULL default '',

entry_company varchar(32) default NULL,

entry_firstname varchar(32) NOT NULL default '',

entry_lastname varchar(32) NOT NULL default '',

entry_street_address varchar(64) NOT NULL default '',

entry_suburb varchar(32) default NULL,

entry_postcode varchar(10) NOT NULL default '',

entry_city varchar(32) NOT NULL default '',

entry_state varchar(32) default NULL,

entry_country_id int(11) NOT NULL default '0',

entry_zone_id int(11) NOT NULL default '0',

PRIMARY KEY (address_book_id,customers_id),

KEY idx_address_book_customers_id (customers_id)

) TYPE=MyISAM;

 

can anyone help i am trying to make it match the cvs for 0519 but i keep getting errors

Link to comment
Share on other sites

i don't understand the relations ship between:

 

customers_default_address_id (table customers)

 

and

 

address_book_id (table address_book)

 

if the address_book_id has the be unique (auto-increment primary index)

what is the customer_default_address_id

Link to comment
Share on other sites

one is for the main address, the other is for additional address book entries.

 

to upgrade your table use myPHPadmin and use ALTER instead of DROP/CREATE... that simple...

 

hint: create a user on your own, check his UID and create a few addresses ... you'll see how the tables corelate

Link to comment
Share on other sites

ouch i had go through the customer`s table and manually renumber the default address id as all address ids are unique in the address_book table (autoincrement)

 

thanks for the help

 

- Kevin

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...