Discussion:
Generating Foreign Keys in PowerDesigner version 11.0
(too old to reply)
Jim Kotan
2005-03-23 20:02:55 UTC
Permalink
I use PowerDesigner version 11.0 to do all my DB design stuff.
We are an Oracle shop but are looking at MySQL for some of our smaller
stuff.

Generating a database (including Foreign & Primary Keys) is easy,
EXCEPT when it comes to doing it for MySQL 4. The options for Foreign
Keys are grayed out so it will not gen FKs. Here's a portion of what it
does generate (just 1 of the 45 tables for this part of the
application):

create table BALLOT_CANDIDATE
(
BALL_CAND_ID int not null,
BALL_CONT_ID int,
RESPONSE_ORDER_NUMBER int,
PART_ID int,
BALL_CAND_TYPE_CODE char(3),
QUESTION_RESPONSE_ID int,
primary key (BALL_CAND_ID)
)
type = InnoDB;

create index REFERENCE_44_FK (BALL_CONT_ID);
create index REFERENCE_58_FK (PARTY_ID);

As you can see, no FKs, *AND* the create index statements are outside
the table, rather than inside.

As I said earlier, the options to generate FKs is grayed out for
MySQL4-type databases, but it works fine for Oracle.

This is driving me absolutely insane (which is a VERY short drive), so
any help is GREATLY appreciated!!

Jim
***@_tconl.com_
(Remove Underscores to send e-mail, please).
Jim Kotan
2005-03-24 17:04:21 UTC
Permalink
All,
I found the problem. I'll post the solution for anyone else who runs
into the same issues.

I had to first physically modify the XDB file as in Joey Silva's post
of November 13, 2004
(change create index %referenceCode%_FK
to create index %referenceCode%_FK ON %TABLE% ).

Next, I had to go in to Script>Objects>Reference and enable References.
This allowed me to turn the options on.
Jim

Loading...