title: MySql - Sequalize - Cannot add foreign key constraint
body: <p>I am trying to using Nodejs sequelize to create database. The commands being invoked are</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `wheel` (`id` INTEGER NOT NULL auto_increment , `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, `shopId` VARCHAR(255), PRIMARY KEY (`id`), 
  FOREIGN KEY (`shopId`) REFERENCES `shop` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;
  
  CREATE TABLE IF NOT EXISTS `segments` (`segmentID` VARCHAR(255) NOT NULL , `heading` VARCHAR(255) NOT NULL, `subHeading` VARCHAR(255) NOT NULL, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, `wheelId` INTEGER, PRIMARY KEY (`segmentID`),
   FOREIGN KEY (`wheelId`) REFERENCES `wheel` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;
  
  CREATE TABLE IF NOT EXISTS `shop` (`id` VARCHAR(255) NOT NULL , `accessToken` VARCHAR(255) NOT NULL, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;
  </code></pre>
  
  <p>But I get this error </p>
  
  <blockquote>
    <p>Unhandled rejection SequelizeDatabaseError: ER_CANNOT_ADD_FOREIGN:
    Cannot add foreign key constraint</p>
  </blockquote>
  
  <p>When I try to see the last foreign key error , it says </p>
  
  <pre><code>------------------------
  LATEST FOREIGN KEY ERROR
  ------------------------
  2016-07-28 19:23:21 0x700000d95000 Error in foreign key constraint of table exitpopup/segments:
  FOREIGN KEY (`wheelId`) REFERENCES `wheel` (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB:
  Cannot resolve table name close to:
   (`id`) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB
  </code></pre>
  
  <p>Strangely, When I put the sql statements in sql console , it works and there isn't any error.
  What am I doing wrong ?</p>