Page 1 of 1

Schema in DDL generation

PostPosted: Mon May 20, 2013 1:59 am
by gregsoulsby
I am generating from UML to MySQL DDL.

The index code generated is of the form:

CREATE INDEX fk_xyz ON p1.p2.abc(fk_def);

where p1 and p2 look like schema of some sort.

This fails in MySQL with invalid SQL on the p1.p2. It runs without error when I delete the p1.p2.

What are these schema and what is the approach to getting MD to generating the DLL to run in MYSQL without editing?

Thanks

Re: Schema in DDL generation

PostPosted: Mon May 20, 2013 7:32 am
by TomasJkn
Hello Greg,
Yes you are right - these are supposed to be schema names. However there is a problem in the qualified name generator - it mistakenly takes too much upstream packages when generating schema names. It should be just one level: *p2.abc* where *p2* is the schema name (if any) and *abc* is the table name.

To work this around switch off the *Generate qualified names* option in the code generator; this will make the generated index names unqualified; in your case this will result in the following SQL:
CREATE INDEX fk_xyz ON abc(fk_def);

Rightclick your code engineering set>Properties>Generation Features>Generate qualified names, set to false.

Sincerely,
Tomas Juknevicius