title: mysql workbench error code 1215: can't add foreign key constraint
body: <p>I am sure I have followed the answers seen from other posts, but my code is still wrong. I am not sure how o add in foreign keys to my table. I followed the instruction given on the tutorial website as well. </p>
  
  <pre><code>DROP TABLE IF EXISTS `Spatuala` ;
  
  CREATE TABLE IF NOT EXISTS `Spatuala`(
      `idSpatula` INT NOT NULL,
      `ProductName` VARCHAR(50) NULL,
      `Type` ENUM('Food', 'Drugs', 'Paints', 'Plaster') NOT NULL,
      `Size` VARCHAR(50),
      `Colour` VARCHAR(50),
      `Price` DECIMAL(10,2),
      `QuantityInStock` INT NOT NULL,
      PRIMARY KEY (`idSpatula`))
  ENGINE = InnoDB;
  
  DROP TABLE IF EXISTS `Order`;
  
  CREATE TABLE IF NOT EXISTS `Order`(
      `idOrder` INT NOT NULL,
      `RequestedTime` DATETIME NOT NULL,
      `ResponsibleStaffMember` VARCHAR(100),
      `CustomerDetails` VARCHAR(300),
      PRIMARY KEY (`idOrder`))
  ENGINE = InnoDB;
  
  DROP TABLE IF EXISTS `OrderLineItem`;
  
  CREATE TABLE IF NOT EXISTS `OrderLineItem`(
      `idSpatula` INT NOT NULL,
      `idOrder` INT NOT NULL,
      `Quantity` INT NOT NULL,
      FOREIGN KEY (`idSpatula`)
        REFERENCES `Spatula` (`idSpatula`)
        ON DELETE NO ACTION
        ON UPDATE NO ACTION,
      FOREIGN KEY (`idOrder`)
        REFERENCES `Order` (`idOrder`)
        ON DELETE NO ACTION
        ON UPDATE NO ACTION)
  ENGINE = InnoDB;
  </code></pre>