title: MySQL Error 150: two VARCHAR(255) attributes
body: <p>I am creating new tables for a archive and I am also setting foreign keys alongside of that.</p>
  
  <p>I tried different kind of varchar sizes, checked InnoDB and such and checked if I made spelling errors in the table names.</p>
  
  <pre><code>CREATE TABLE `VKST_Project`
  (
    `id` int PRIMARY KEY,
    `brand` varchar(255),
    `city` varchar(255),
    `street` varchar(255),
    `plz` varchar(255),
    `center_name` varchar(255),
    `nation` varchar(255),
    `shop_type` varchar(255),
    `state` varchar(255),
    `sales_area` varchar(255),
    `open_date` varchar(255),
    `construction_date` varchar(255),
    `re_open_date` varchar(255),
    `local_manager` varchar(255),
    `window_length` double,
    `object_front_length` double,
    `security_alarm` boolean,
    `security_goods` boolean,
    `fire_sprinklers` boolean,
    `fire_smoke_alarm` boolean,
    `fire_RWA` boolean,
    `advert_modules` varchar(255),
    `tech_equipment` varchar(255),
    `ventilation` varchar(255),
    `heating` varchar(255)
  )  ENGINE=InnoDB DEFAULT CHARSET=utf8;;
  
  CREATE TABLE `Floor`
  (
    `id` int PRIMARY KEY AUTO_INCREMENT,
    `floor_id` varchar(255),
    `object_id` int,
    `floor_space_total` double,
    `floor_space_sales` double,
    `floor_space_store` double,
    `floor_space_others` double,
    `floor_capacity_total` double,
    `floor_capacity_sales` double,
    `floor_capacity_store` double,
    `floor_capacity_others` double
  )  ENGINE=InnoDB DEFAULT CHARSET=utf8;;
  
  CREATE TABLE `Room`
  (
    `id` int PRIMARY KEY AUTO_INCREMENT,
    `room_id` varchar(255),
    `floor_id` varchar(255),
    `object_id` int,
    `name` varchar(255),
    `space` double,
    `height` double,
    `sap` varchar(255),
    `cad_file_name` varchar(255),
    `DIN_Type` varchar(255),
    `GIF_Type` varchar(255)
  )  ENGINE=InnoDB DEFAULT CHARSET=utf8;;
  
  CREATE TABLE `Ceiling`
  (
    `ceiling_id` int PRIMARY KEY AUTO_INCREMENT,
    `room_id` varchar(255),
    `material` varchar(255)
  )  ENGINE=InnoDB DEFAULT CHARSET=utf8;;
  
  CREATE TABLE `Flooring`
  (
    `flooring_id` int PRIMARY KEY AUTO_INCREMENT,
    `room_id` varchar(255),
    `material` varchar(255)
  )  ENGINE=InnoDB DEFAULT CHARSET=utf8;;
  
  ALTER TABLE `Floor` ADD FOREIGN KEY (`object_id`) REFERENCES `VKST_Project` (`id`);
  
  ALTER TABLE `Room` ADD FOREIGN KEY (`floor_id`) REFERENCES `Floor` (`floor_id`);
  
  ALTER TABLE `Room` ADD FOREIGN KEY (`object_id`) REFERENCES `VKST_Project` (`id`);
  
  ALTER TABLE `Ceiling` ADD FOREIGN KEY (`room_id`) REFERENCES `Room` (`room_id`);
  
  ALTER TABLE `Flooring` ADD FOREIGN KEY (`room_id`) REFERENCES `Room` (`room_id`);
  </code></pre>
  
  <p>The Error happens here: ALTER TABLE <code>Room</code> ADD FOREIGN KEY (<code>floor_id</code>) REFERENCES <code>Floor</code> (<code>floor_id</code>);</p>
  
  <p>Error: 150 "Foreign key constraint is incorrectly formed"</p>