- This topic has 2 replies, 2 voices, and was last updated 18 years, 7 months ago by Rik Serpentier.
-
AuthorPosts
-
Rik SerpentierMemberHi,
I am new to the MyEclipseIDE and face a problem with the ER Diagram-tool. As a test I created four tables in MySQL 5.0.10 : `parent`, `child`, `fab` and `cont`. All tables are in the same database. Here are the create table commands :
mysql> show create table parent;
+——–+—————————————————————————————————————+
| Table | Create Table |
+——–+—————————————————————————————————————+
| parent | CREATE TABLE `parent` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+——–+—————————————————————————————————————+
1 row in set (0.01 sec)mysql> show create table child;
+——-+————————————————————————————————————————————————————————————————————————————————–+
| Table | Create Table |
+——-+————————————————————————————————————————————————————————————————————————————————–+
| child | CREATE TABLE `child` (
`id` int(11) default NULL,
`parent_id` int(11) default NULL,
KEY `parent_id` (`parent_id`),
CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+——-+————————————————————————————————————————————————————————————————————————————————–+
1 row in set (0.00 sec)mysql> show create table FAB;
+——-+————————————————————————————————————+
| Table | Create Table |
+——-+————————————————————————————————————+
| FAB | CREATE TABLE `FAB` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+——-+————————————————————————————————————+
1 row in set (0.00 sec)mysql> show create table CONT;
+——-+———————————————————————————————————————————————————————————————————————————+
| Table | Create Table |
+——-+———————————————————————————————————————————————————————————————————————————+
| CONT | CREATE TABLE `CONT` (
`id` int(11) default NULL,
`fab_id` int(11) default NULL,
KEY `fab_id` (`fab_id`),
CONSTRAINT `cont_ibfk_1` FOREIGN KEY (`fab_id`) REFERENCES `fab` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+——-+———————————————————————————————————————————————————————————————————————————+
1 row in set (0.07 sec)As you see the tables “parent” and “child” are a couple with a relation, and the tables “fab” and “cont” too. Why is the ER Diagram tool only showing the relationship of the “parent”-“child”-tables and not of the “fab”-“cont”-tables ? When inserting data it seems that both foreign key constraints work. ?
Any help, hints,… Thanks.[/img]
Haris PecoMemberserpentierr ,
I have tried reproduce your case and it work with some problems :
you make table FAB with create table `FAB` (upper case FAB) and constraint command in CONT is lower case
when i convert `fab` (in create table `CONT`) to upper case it work fine (command and ER diagram make diagram
with all relations)Check (in db explorer) do you have all foreign keys – you must be careful about upper and lower case when you use quoted identifiers
Best
Rik SerpentierMemberYour tip solved the “problem”. Thank you.
-
AuthorPosts