artistwantab
artistwantab

Reputation: 19

Check Column/Key Exists?

I am running x-cart 4.23 and upgrading to 4.4 so I need to upgrade the database.

Here is the error.

SQL error #1091 : Can't DROP 'PRIMARY'; check that column/key exists SQL query: ALTER TABLE xcart_customers DROP PRIMARY KEY

The original error was this....

SQL error #1075 : Incorrect table definition; there can be only one auto column and it must be defined as a key

SQL query: ALTER TABLE xcart_customers DROP PRIMARY KEY

When I cleared that I ran into that and have no idea where to start.

Upvotes: 1

Views: 21861

Answers (1)

Eric Fortis
Eric Fortis

Reputation: 17350

This error means that you are trying to delete a key which is being used by another table.

e.g. consider tblMovies and tblActors, movies contain one or more actors and you can't delete delete the tblActors entries (or drop PK) until you delete the Movies featuring those actors.

Then the actors won't be linked so you can delete them.

Upvotes: 1

Related Questions