我在InnoDB有一个表格,使用设在外凯的VARCHAR:
CREATE TABLE `portal_equity` (
`isin` varchar(12) NOT NULL,
....,
PRIMARY KEY (`isin`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8
另一表对表有外在限制:
CONSTRAINT `equity_id_refs_isin_2581bb1d` FOREIGN KEY (`equity_id`) REFERENCES `portal_equity` (`isin`)
我需要改变主要的VARCHAR栏的长度,因此我这样做。 现在,每当我想从“自由——平等”表中提一句话时,我就会发现以下正直错误,因为那一字的长度超过了原来的12年。
Foreign key constraint fails for table
investtor
.portal_equitypastvalue
: CONSTRAINTequity_id_refs_isin_7eed44e7
FOREIGN KEY (equity_id
) REFERENCESportal_equity
(isin
) Trying to add in child table, in indexportal_equitypastvalue_equity_id_6e7526e1
tuple: DATA TUPLE: 3 fields; 0: len 12; hex 304c55303332333133343030; asc 0LU032313400;; 1: len 3; hex 8fb578; asc x;; 2: len 4; hex 8001398a; asc 9 ;;But in parent table
investtor
.portal_equity
, in indexPRIMARY
, the closest match we can find is record: PHYSICAL RECORD: n_fields 9; compact format; info bits 0 0: len 13; hex 304c5530333233313334303036; asc 0LU0323134006;; 1: len 6; hex 000000005139; asc Q9;; 2: len 7; hex 800000002d0110; asc - ;; 3: len 4; hex 61736466; asc asdf;; 4: len 4; hex 80000050; asc P;; 5: len 3; hex 736466; asc sdf;; 6: len 4; hex 80000001; asc ;; 7: len 2; hex 4144; asc AD;; 8: len 0; hex ; asc ;;
我是否需要重新提出所有外国关键制约因素? 这似乎相当过分。 这种行为/行为是否在其他地方有记载?