运行生气了语句:
CREATE TABLE net_ippoolexludesection
(sectionId
int(11) NOT NULL AUTO_INCREMENT,ippoolId
int(11) NOT NULL COMMENT '地址池ID',routeId
int(11) NOT NULL COMMENT '设备ID',startip
varchar(15) NOT NULL COMMENT '起始地址',endip
varchar(15) NOT NULL COMMENT '结束地址',lstartip
bigint(255) NOT NULL COMMENT '其实IP',lendip
bigint(255) NOT NULL COMMENT '结束IP',
PRIMARY KEY (sectionId
),
CONSTRAINT net_ippoolexludesection_ibfk_1
FOREIGN KEY (ippoolId
) REFERENCES net_ippoolinfo
(poolid
) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ip地址池排除地址段';
报错 Err] 1215 - Cannot add foreign key constraint
net_ippoolinfo 表的结构如下
CREATE TABLE net_ippoolinfo
(poolid
int(7) NOT NULL AUTO_INCREMENT,poolName
varchar(50) NOT NULL,routid
int(11) NOT NULL,gateway
varchar(15) DEFAULT NULL,maskStr
varchar(15) DEFAULT NULL,dnsip
varchar(50) DEFAULT NULL,poolSection
varchar(200) DEFAULT NULL,vpnName
varchar(50) DEFAULT NULL,maxUseNum
int(7) DEFAULT NULL,produceTime
datetime DEFAULT NULL,poolDomain
varchar(255) DEFAULT NULL,poolDomain1
varchar(255) DEFAULT NULL,
PRIMARY KEY (poolid
),
UNIQUE KEY dd
(poolid
)
) ENGINE=InnoDB AUTO_INCREMENT=220 DEFAULT CHARSET=utf8;
mysql 版本 5.6
就大神指教,