After trying to run:
alter table
strange message appeared:
Error on rename of '.\database\#sql-6ec-13' to '.\database\
This is because adding foreign keys also adds an index key to the table (for optimization needs).Therefore to delete mentioned column You need:
- Run show create table table_name
and see what keys and foreign keys are created on mentioned column; - Delete all keys using alter table
drop key key_name ; - Delete all foreign keys using alter table
drop foreign key foreign_key_name ; - Drop needed column alter table table_name
drop column_name;
No comments:
Post a Comment