user1015214
user1015214

Reputation: 3091

Mysql error #1064 when renaming columns

I am gettting a mysql error when trying to change the column names on these tables:

alter field_data_commerce_customer_address CHANGE field_mcaf_middle_name commerce_customer_address_middle_name varchar (255);
alter field_revision_commerce_customer_address CHANGE field_mcaf_middle_name commerce_customer_address_middle_name varchar (255);

This is my error

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'field_data_commerce_customer_address CHANGE field_mcaf_middle_name commerce_cust' at line 1 

I checked the table and column names and they are correct. What am I missing

Upvotes: 0

Views: 1813

Answers (1)

Michael  Livach
Michael Livach

Reputation: 518

You missed 'TABLE' word:

alter TABLE field_data_commerce_customer_address CHANGE field_mcaf_middle_name commerce_customer_address_middle_name varchar (255);
alter TABLE field_revision_commerce_customer_address CHANGE field_mcaf_middle_name commerce_customer_address_middle_name varchar (255);

Upvotes: 2

Related Questions