title: MySQL: Error Message Can't create table (errno: 150)
body: <p>I have two tables, 'po' and 'receive'</p>
  
  <pre><code>CREATE TABLE `po` (
    `PO_ID` bigint(20) NOT NULL,
    `SERVICE_TYPE` bit(1) DEFAULT NULL,
    `ENTRY_DATE` date NOT NULL,
    `RECEIPT_DATE` date DEFAULT NULL,
    `TURNOVER` date DEFAULT NULL,
    `MOBILIZATION` date DEFAULT NULL,
    `SITE_NAME` varchar(255) NOT NULL,
    `SITE_CODE` varchar(45) DEFAULT NULL,
    `SITE_TIN` varchar(45) DEFAULT NULL,
    `SITE_ADDRESS` varchar(255) NOT NULL,
    `COST` decimal(11,2) NOT NULL,
    `XML` text,
    PRIMARY KEY (`PO_ID`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
  
  CREATE TABLE `receive` (
    `RECEIPT_ID` varchar(100) NOT NULL,
    `RECEIPT_DATE` date NOT NULL,
    `PO_NUMBER` bigint(20) NOT NULL,
    `SUPPLIER_ID` int(11) NOT NULL,
    PRIMARY KEY (`RECEIPT_ID`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8$$
  </code></pre>
  
  <p>I'm trying to connect two tables by defining a foreign key 'fk_po' on the table 'receive'</p>
  
  <pre><code>ALTER TABLE `fourthwave`.`receive` 
    ADD CONSTRAINT `fk_po`
    FOREIGN KEY (`PO_NUMBER` )
    REFERENCES `fourthwave`.`po` (`PO_ID` )
    ON DELETE SET NULL
    ON UPDATE SET NULL
  , ADD INDEX `fk_po` (`PO_NUMBER` ASC)
  </code></pre>
  
  <p>However, the alter query above throws an error : </p>
  
  <pre><code>Error Code: 1005. Can't create table 'fourthwave.#sql-aec_11' (errno:150)
  </code></pre>
  
  <p>Am i getting this error because the field's names, 'PO_ID' and 'PO_NUMBER' on both tables are different?</p>