Question

I create my relations in EER diagram and I want to see foreing key on my table. I readed this article

but when I do it, there is and error like this:

    Executing SQL script in server

ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(11) NOT NULL  AFTER `UserId` 

, DROP PRIMARY KEY 

, ADD PRIMARY KEY (`AddressId' at line 1





ALTER TABLE `kobiakinlar`.`address` ADD COLUMN `user_UserId` (11) NOT NULL  AFTER `UserId` 

, DROP PRIMARY KEY 

, ADD PRIMARY KEY (`AddressId`, `user_UserId`) 

, ADD INDEX `fk_address_user_idx` (`user_UserId` ASC) 



SQL script execution finished: statements: 3 succeeded, 1 failed

How can I synchronize my table with EER diagram.

Was it helpful?

Solution

I noticed that I need to set MySql storage engines to InnoDB. As you can see in MySQL WorkBench Foreign Key Tab, the server accepts foreign key definitions for other storage engines but silently ignores them. You can read about storage engines in here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top