Reputation: 1751
I have two table customer and Address
Customer table has fields
- cust_id (PK) BINARY(16)
- address_id (FK) BINARY(16)
- cust_name VARCHAR(32)
Address table has fields
- address_id (Pk) BINARY(16)
- address_name VARCHAR(250)
Now I need to modify the column type for address_id from BINARY(16) to CHAR(36) , but I am getting the error:
I am doing like this
ALTER TABLE Addresses MODIFY COLUMN address_id CHAR(16);
ERROR 1025 (HY000): Error on rename of './ShipMileData/#sql-531_240' to './ShipMileData/Addresses' (errno: 150)
Upvotes: 0
Views: 54
Reputation: 780724
Remove the FOREIGN KEY
constraint from the Customer
table. Then ALTER
the column types in both tables, and add back the FK.
Upvotes: 1