Book a Demo

Author Topic: Generating DDL  (Read 3895 times)

brantph

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Generating DDL
« on: May 23, 2003, 12:42:45 pm »
I am generasting the DDL code for my tables, however, some FK constraints are not showing up.  What to do?

edwardmilne

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Generating DDL
« Reply #1 on: July 15, 2003, 04:14:20 am »
I had this problem too.

on all of your classes, make sure that the stereo type is set to 'table'.

make sure that one of the fields that needs to be unique is set to 'Primary Key'

next put an association between the two classes. In the association properties, there is a 'source role' and a 'target role' tab. on the source role tab, select the field that you want to act as a foreign key. On the target role tab, select the primary key that the foreign key needs to reference. click OK. Now LOOK at the class. you'll notice on one of them that EA has made a foreegn key (begins with FK or something). Go BACK into the link properties and select the source tab. In the combo box select THIS foreign key. Now when you generate DDL, all of the foreign key constraints will be in there.

Not very intuitive I know. But it works.

hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Generating DDL
« Reply #2 on: July 15, 2003, 03:45:13 pm »
Just to let you know, we are currently improving foreign key creation, DDL import and generation and other aspects of the data modeling feature.

We expect to have some major changes in the next release (3.60) of  EA.

bonderLA

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Generating DDL
« Reply #3 on: July 21, 2003, 02:55:05 pm »
A bit more intuitive:

  • Drag an associate link from the table that has the foreign key column (eg, OrderDetails) to the table with the primary key.

  • Double-click the link.

  • Under source tab, select the FK column (eg, OrderID).

  • Under target tab, select the PK constraint (eg, PK_Order).

  • Click OK.


This process gets EA to add the FK for you.    8)