Bug #66489 | Option "Generate separate CREATE INDEX statements" should do the same for FKs | ||
---|---|---|---|
Submitted: | 21 Aug 2012 20:38 | Modified: | 23 Sep 2012 6:18 |
Reporter: | Luke Stevens | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Workbench: Modeling | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[21 Aug 2012 20:38]
Luke Stevens
[23 Aug 2012 6:18]
Valeriy Kravchuk
What exact Workbench and server versions do you use? With 5.2.42 and recent 5.5.x I do NOT see two indexes after executing the script generated: mysql> USE `mydb` ; Database changed mysql> mysql> -- ----------------------------------------------------- mysql> -- Table `mydb`.`table1` mysql> -- ----------------------------------------------------- mysql> CREATE TABLE IF NOT EXISTS `mydb`.`table1` ( -> `id` INT NOT NULL , -> PRIMARY KEY (`id`) ) -> ENGINE = InnoDB; Query OK, 0 rows affected (0.28 sec) mysql> mysql> mysql> -- ----------------------------------------------------- mysql> -- Table `mydb`.`table2` mysql> -- ----------------------------------------------------- mysql> CREATE TABLE IF NOT EXISTS `mydb`.`table2` ( -> `id` INT NOT NULL , -> `table1_id` INT NOT NULL , -> PRIMARY KEY (`id`) , -> CONSTRAINT `fk_table2_table1` -> FOREIGN KEY (`table1_id` ) -> REFERENCES `mydb`.`table1` (`id` ) -> ON DELETE NO ACTION -> ON UPDATE NO ACTION) -> ENGINE = InnoDB; Query OK, 0 rows affected (0.40 sec) mysql> mysql> CREATE INDEX `fk_table2_table1_idx` ON `mydb`.`table2` (`table1_id` ASC) ; Query OK, 0 rows affected (0.54 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> mysql> mysql> mysql> SET SQL_MODE=@OLD_SQL_MODE; Query OK, 0 rows affected (0.00 sec) mysql> SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; Query OK, 0 rows affected (0.00 sec) mysql> SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; Query OK, 0 rows affected (0.00 sec) mysql> show create table table2\G *************************** 1. row *************************** Table: table2 Create Table: CREATE TABLE `table2` ( `id` int(11) NOT NULL, `table1_id` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `fk_table2_table1_idx` (`table1_id`), CONSTRAINT `fk_table2_table1` FOREIGN KEY (`table1_id`) REFERENCES `table1` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.05 sec)
[24 Sep 2012 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".