?
Solved

MySQL Workbench - drawing 1:n relationships on model diagram

Posted on 2015-02-14
4
Medium Priority
?
149 Views
Last Modified: 2015-07-22
In the graphical display of tables and fields,
When i add a       1-to-many    relationship,      it does draw the line between the two tables,
but    (in Connect to Columns mode)   it adds a new field instead of using the foreign key already there which i had defined.

How can i connect from a specific EXISTING field (foreign index)  (on the "many" end of the arrow)  (which my naming convention uses, ColorID)   instead of having it add a new field in the table
tblColors_ID.

I'm also open to learn of tools other than WorkBench that can display/manipulate schema graphical diagrams.
I had used  FlashMySQLAdmin for years (albeit a few bugs, but workable and great looking results), which had a very nice graphical table interface and relationship editing interface, but alas it is no longer supported (PHP4, etc.).  (Someone should take it on and update it and sell it, quite a useful tool)

my example from above....

tblProducts            tblColors
ID                             ID
ColorID                   ColorName
0
Comment
Question by:willsherwood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Evan Cutler earned 2000 total points
ID: 40892813
When working with MYSQL  workbench,  on the diagram toolbar, look for the 1-n icon that has the eyedropper.  It will have the ability to select FK columns and PK columns referring to them.  

When you click the 1-n icon with the eyedropper, a black dialog box will appear asking for you to select the FK then the PK.

Hope this helps
0
 

Author Comment

by:willsherwood
ID: 40893361
thanks for this help!
it explains the eyedropper.
when i do this, indeed i can individually select the fields to specify the exact field
(it seems to want the primary key first then the usage of it as a FK)
however,  the resulting graphics shows only table to table.
it does not point field to field.
i had been spoiled by another tool (now defunct)  which
has the lines pointing specifically to the fields within each table  (not just a somewhat random placement to the edge of the table)
any thoughts?
0
 
LVL 9

Assisted Solution

by:Evan Cutler
Evan Cutler earned 2000 total points
ID: 40893624
Try this:In the main menu bar go to: Model -> Relationship Notation -> Connect to columns.
0
 

Author Closing Comment

by:willsherwood
ID: 40893661
excellent - the combination of these two tips is the solution!!

THANK YOU!
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating and Managing Databases with phpMyAdmin in cPanel.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question