whenever I do insert into 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 do I resolve this issue?
It's hard to guess what is wrong without details, but there are some common mistakes you might make : 1. yyy.yyy_id is not a unique/primary key
2. yyy.yyy_id and xxx.my_yyy_id have different types (e.g.
yyy_id unsigned int
,xxx.my_yyy_id int
)