Solved

MySQL Workbench - drawing 1:n relationships on model diagram

Posted on 2015-02-14
4
137 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 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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