sql - mysql error 150 Foreign keys -
whenever insert table xxx:
alter table xxx add index fk68c3166c7b556202 (my_yyy_id), add constraint fk68c3166c7b556202 foreign key (my_yyy_id) references yyy (yyy_id)
...i get:
19:27:44,355 error schemaupdate:212 - unsuccessful: alter table xxx add index fk68c3166c7b556202 (my_yyy_id), add constraint fk68c3166c7b556202 foreign key (my_yyy_id) references yyy (yyy_id) 19:27:44,356 error schemaupdate:213 - can't create table 'mydb.#sql-2f1b_657' (errno: 150)
why? how resolve issue?
it's hard guess wrong without details, there common mistakes might make : 1. yyy.yyy_id not unique/primary key
2. yyy.yyy_id , xxx.my_yyy_id have different types (e.g. yyy_id unsigned int
, xxx.my_yyy_id int
)
Comments
Post a Comment