В базе есть две таблицы: 
CREATE TABLE `bid` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `time` date DEFAULT NULL,
  `amount` float NOT NULL DEFAULT '0',
  `currency_id` int(11) DEFAULT NULL,
  `currency_rate` float NOT NULL DEFAULT '0',
  `city` varchar(200) DEFAULT NULL,
  `comment` text,
  `type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `type` (
  `type_id` int(11) NOT NULL,
  `type_name` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
хочу на поле type_id в таблице bid повесить foreign key на таблицу type на поле type_id 
alter table bid add foreign key(type_id) references type(type_id);
но получаю ошибку: #1452 - Cannot add or update a child row: a foreign key constraint fails (`apple`.`#sql-1b34_f5`, CONSTRAINT `#sql-1b34_f5_ibfk_1` FOREIGN KEY (`type_id`) REFERENCES `type` (`type_id`))
в чем может быть проблема ?