 |
Bug Information
|
| Title: |
InnoDB and Foreign Keys |
 |
| Text: |
Hello!
First of all, sorry my bad english. I'm Brazilian.
So, I have some problems using DBDesigner. The names I supply for Foreign Keys their not use to create Foreign Keys, using unamed constraints. SO I cant create more than one Foreign Key in the same table.
Here I post how DBDesigner creates the Foreign Key sintax:
CREATE TABLE Default (no prefix).banner_sessao(
cod_sessao VARCHAR(10) NOT NULL,
cod_banner VARCHAR(10) NOT NULL,
PRIMARY KEY(cod_sessao, cod_banner),
INDEX idx_banner_site(cod_sessao),
INDEX idx_banner(cod_banner),
FOREIGN KEY (cod_sessao)
REFERENCES sessao_site(cod_sessao)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY (cod_banner)
REFERENCES banner(cod_banner)
ON DELETE NO ACTION
ON UPDATE NO ACTION
) TYPE=InnoDB;
... and How must to be:
FOREIGN KEY FK_sessao_site (cod_sessao)
REFERENCES sessao_site(cod_sessao)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
FOREIGN KEY FK_banner (cod_banner)
REFERENCES banner(cod_banner)
ON DELETE NO ACTION
ON UPDATE NO ACTION
Thanks a lot, and sorry something.
Best Regards,
Eduardo Schoedler.
|
|