Book a Demo

Author Topic: DDL Generation 6.1.791  (Read 4134 times)

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
DDL Generation 6.1.791
« on: June 14, 2006, 10:40:31 am »
I have recently upgraded from 5 to the latest release and have noticed a few things, mainly with the DDL Code generation for an entire package (right click on the package and select generate ddl).

The method of selecting a few of the tables does not always work. In our case we have about 30 tables. When I generate the entire set one is missed (its name is node_seed) but I can get similar behaviour when I select one table and press the generate button; no ddl is created. This happens on more tables than just the missing one that I mentioned.

Maybe this has something to do with the foreign key relationships?

Also note that if the generate ddl is selected from the right click menu for a single table it works fine. Even the tables that do not work from the generate ddl interface for the package.

Has anyone else experienced this sort of issue?

Any ideas would be welcome. I did do a search for this issue but couldn't find any, sorry if this is a repeat.




DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: DDL Generation 6.1.791
« Reply #1 on: June 15, 2006, 03:15:49 am »
Ok found the issue for those that are interested.


http://www.davidnarelle.com/EA/ddl-bug.gif

Here is how to reproduce the problem. For those that cannot be bothered; the issue is when you have a self referencing foreign key. When using the generate DDL any table that has a foreign key target to that table will not be generated. So that is Table1 and Table3 in the diagram! :o

The EAP File

Create a new Project or download the eap from

http://www.davidnarelle.com/EA/ddl-bug.zip

How to create the eap file

Select "Database" Model.

Open the "Schema1" package.

Using the default schema package where Table1 references Table2.

Change the tables to MySQL

Add the following columns to Table1

id BIGINT PK
name String

Add the following columns to Table2

id BIGINT PK
parent_id BIGINT

Update the foreign key relationship betwen table1 and table2 using the ids of both tables. That is Table1 id is a reference to Table2's id.

The parent_id is a self reference to its self; that is the foreign key points back to the same table. To do this add an association that references Table2 to its self. Update the foreign key and set the Source: Table2 parent_id column to Target: Table 2 id column. Click save.

The bug

Right click on the package Schema1 and select Code Engineering -> Generate DDL...

Select all tables, select a file to save the ddl to and then click generate.

The list of tables that have been generated will only include Table2. Table1 is not created. Only Table2 will be generated. If you have downloaded the project file then it contains an additional table (Table3) which is also not created.

Also note that by selecting just table 2 (not table1) and click generate no tables will be created! :o

thomaskilian

  • Guest
Re: DDL Generation 6.1.791
« Reply #2 on: June 15, 2006, 03:22:16 am »
Please do not forget to explicitely send the bug report using Sparx' form on the support page. Just make a reference to your post :)

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: DDL Generation 6.1.791
« Reply #3 on: June 15, 2006, 03:30:48 am »
Bug already submitted. Didn't reference post  :-[ oops.

thomaskilian

  • Guest
Re: DDL Generation 6.1.791
« Reply #4 on: June 15, 2006, 05:24:10 am »
Don't mind. They watch the board and will probably find out.

DavidR

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: DDL Generation 6.1.791
« Reply #5 on: July 14, 2006, 04:00:42 am »
I had prematurely :-[ posted that it had been fixed!

I was looking for the wrong table! So sorry folks it is still a bug. Hopefully soon this will be fixed. For now I have to generate the missing table separately.  :(