Table CARGO
DROP TABLE IF EXISTS \"hibernatecurso\".\"cargo\";
CREATE TABLE \"hibernatecurso\".\"cargo\" (
\"idcargo\" int(11) NOT NULL DEFAULT \'0\',
\"fun
I had the same kind of issue and I fixed it by making sure that collation and types matched in both FK and the parent PK.
I maybe have hard time reading, but I don't see any index on cargo.funcao
. This is very probably missing:
ALTER TABLE `hibernatecurso`.`cargo` ADD INDEX `idx_funcao`(`funcao`);
InnoDB permits a foreign key to reference any index column or group of columns. However, in the referenced table, there must be an index where the referenced columns are listed as the first columns in the same order.
http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html