-1

I have tables Employees and Project.

Project table have ProjectCreator and ProjectManager fields, which both references Employees.EmployeeID.

I added the foreign keys exactly the same in MySQL Workbench, however, they show up differently in the diagram:

-|O------E [ProjectCreator]

-||-------E [ProjectManager]

Anyone know why this happened? Both fields have 0 as the default value.

James T
  • 99
  • 6
  • 1
    Please in code questions give a [mre]--cut & paste & runnable code, including smallest representative example input as code; desired & actual output (including verbatim error messages); tags & versions; clear specification & explanation. Give the least code you can give that is code that you show is OK extended by code that you show is not OK. (Debugging fundamental.) For SQL that includes DBMS & DDL (including constraints & indexes) & input as code formatted as a table. – philipxy Apr 04 '20 at 02:37
  • This isn't a code question... – James T Apr 06 '20 at 07:53
  • "I have tables Employees and Project." Because your gui manages code to create them. MySQL code--your own tag choice. Find out how to dump your SQL. Moreover you can cut & paste relevant information from your gui about those tables. (Please text, not images, for what can be given in text.) PS Presumably you implicitly have some column to accept NULLs so you get (0-or-1):M & another NOT NULL so you get 1:M. PS A column's default is distinct from its nullability. PS Read the manual re the functionality you are using. – philipxy Apr 06 '20 at 08:10
  • Clearly this is going to be a faq. Before considering posting please read the manual & google any error message or many clear, concise & precise phrasings of your question/problem/goal, with & without your particular strings/names & site:stackoverflow.com & tags; read many answers. If you post a question, use one phrasing as title. Reflect your research. See [ask] & the voting arrow mouseover texts. – philipxy Apr 06 '20 at 08:10
  • 1
    Well this was useless. FYI, the problem was a "bug" in MySQL Workbench. After I restarted the application it drew it correctly. – James T Apr 07 '20 at 08:03
  • @JamesT Great that you found the solution. Add it as self-answer to help other facing the same issue. – howlger Apr 07 '20 at 09:08

1 Answers1

0

Issue was with MySQL Benchmark. It didn't draw the diagram correctly until I restarted the application.

James T
  • 99
  • 6