Customized DDL Generation

Our organization has some very specific requirements for DDL Code. VPUML does a good job of giving me the basics, but I still end up spending a lot of time modifying the generated DDL files. I understand that our requirements are unusual so I’d like to know if there is a way that I can modify the template or rules used to generate the DDL scripts so the output meets our needs.

Here are some of the things I need to modify:

[ul]Foreign Keys must be deferred.
I need all Foreign Key constraint definitions to use DEFERRABLE INITIALLY DEFERRED [/ul]

[ul]NOT NULL constraints must be named
All constraints must be named following a pattern similar to the existing functionality for naming PK and FK constraints. I can’t just specify NOT NULL in the column definition, it needs to be a separate, named CHECK constraint - something like “NN_{table_name}_{column_name}”[/ul]

[ul]No need for a NOT NULL constraint on the Primary Key column.
Our database engine (FrontBase) automatically manages a NOT NULL constraint for the PK and therefore defining it again creates a duplicate[/ul]

There are other (more minor) changes we’d like to make as well. Is there any way to override or extend VPUML’s SQL generation?