title: MySQL Alter table strange key error
body: <p>I am using MySQL Workbench to create a large database.</p>
  
  <p>I keep getting:</p>
  
  <blockquote>
    <p>ERROR: Error 1089: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys</p>
  </blockquote>
  
  <p>When trying to execute the following query:</p>
  
  <pre><code>ALTER TABLE `view4`.`entities` DROP COLUMN `resellerType` ,
  DROP COLUMN `industrTypeId` ,
  DROP COLUMN `paymentTermsId` ,
  ADD COLUMN `paymentTermsId` INT(11) NOT NULL  AFTER `vatRateId` ,
  ADD COLUMN `industrTypeId` INT(11) NOT NULL  AFTER `paymentTermsId` ,
  ADD COLUMN `resellerType` INT(11) NOT NULL  AFTER `industrTypeId` ,
  DROP FOREIGN KEY `fk_entities_grades1`
  </code></pre>
  
  <p>I have tried changing the length of various INT columns but it has no effect. I am also getting this error on a few other tables.</p>
  
  <p>What is workbench doing wrong?</p>
  
  <hr>
  
  <p>I've reduced it a bit to:</p>
  
  <pre><code>ALTER TABLE `view4`.`entities` DROP COLUMN `resellerType` ,
  DROP COLUMN `industrTypeId`  , 
  ADD COLUMN `industrTypeId` INT(11) NOT NULL  AFTER `paymentTermsId` ,
  ADD COLUMN `resellerType` INT(11) NOT NULL  AFTER `industrTypeId` 
  </code></pre>
  
  <p>and it's still giving me the error.</p>