I just used the MySQL mysqldump tool to generate DDL so I could create the sane database on another machine. When I try to run it on the target machine I get this error:
Script line: 28 Key column 'friendPrimaryKeyInYour Phone' doesn't exist in table
running this statement:
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `friend` (
`id` bigint(20) unsigned NOT NULL,
`dependentId` bigint(20) unsigned NOT NULL,
`friendPrimaryKeyInYourPhone` int(10) unsigned NOT NULL,
`friendNameInYourPhone` varchar(45) NOT NULL,
`date` datetime NOT NULL,
PRIMARY KEY (`id`,`friendPrimaryKeyInYourPhone`) USING BTREE,
UNIQUE KEY `idx_dependendentId_phonePk` (`dependentId`,`friendPrimaryKeyInYour
Phone`),
KEY `idx_phonePk` (`friendPrimaryKeyInYourPhone`),
KEY `idx_dependentId` (`dependentId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Any idea how MySQL could generate this DDL and seconds later consider it invalid?