Solved

MySQL Workbench - drawing 1:n relationships on model diagram

Posted on 2015-02-14
4
119 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
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Evan Cutler earned 500 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 500 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now