webyog / sqlyog-community

Webyog provides monitoring and management tools for open source relational databases. We develop easy-to-use MySQL client tools for performance tuning and database management. Webyog's solutions include SQL Diagnostic Manager for MySQL performance optimization and SQLyog for MySQL administration. More than 35,000 companies (including Amazon, IBM, Salesforce, AT&T, eBay, and GE) and 2.5 million users rely on Webyog's solutions to provide valuable insights into their databases. Webyog is an Idera, Inc. company.
https://webyog.com/
GNU General Public License v2.0
2.19k stars 322 forks source link

The Schema Designer fails to add all the child tables of a parent table to the canvas #2276

Closed sibwy closed 2 years ago

sibwy commented 3 years ago

Environment:

  1. SQLyog Ultimate v13.1.7
  2. MySQL v8.0.23

Given the tables below, the steps to reproduce:

  1. Open a blank Schema Designer
  2. Click Add Tables button
  3. Uncheck "Select/Deselect all"
  4. Check table "parent"
  5. Check "Add child tables"
  6. Click Add Not all the tables are added though it has a foreign key referencing to the 'parent' table.

-- Parent table

CREATE TABLE `parent` (
`pid` INT NOT NULL,
`pname` VARCHAR(101) DEFAULT NULL,
`preg_id` INT DEFAULT NULL,
PRIMARY KEY (`pid`),
UNIQUE KEY `unique` (`preg_id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Child table 1

CREATE TABLE `child1` (
`cid` INT NOT NULL,
`cname` INT DEFAULT NULL,
`cno` INT DEFAULT NULL,
PRIMARY KEY (`cid`),
UNIQUE KEY `cno` (`cno`),
CONSTRAINT `child1_ibfk_1` FOREIGN KEY (`cno`) REFERENCES `parent` (`preg_id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Child table 2

CREATE TABLE `child2` (
`cid` INT NOT NULL,
`chname` VARCHAR(10) DEFAULT NULL,
`creg_no` INT DEFAULT NULL,
PRIMARY KEY (`cid`),
KEY `creg_no` (`creg_no`),
CONSTRAINT `child2_ibfk_1` FOREIGN KEY (`cid`) REFERENCES `parent` (`pid`),
CONSTRAINT `child2_ibfk_2` FOREIGN KEY (`creg_no`) REFERENCES `parent` (`preg_id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Child table 3

CREATE TABLE `child3` (
`cid` INT NOT NULL,
`cname3` VARCHAR(10) DEFAULT NULL,
`cno` INT DEFAULT NULL,
PRIMARY KEY (`cid`),
KEY `cno` (`cno`),
CONSTRAINT `child3_ibfk_1` FOREIGN KEY (`cno`) REFERENCES `parent` (`preg_id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

The user report can be found in SF >> 00884259

sibwy commented 2 years ago

Fixed in v13.1.9