Customising the create-table script is NOT RECOMMENDED until you have special reasons.
To customise the create-tables script, you need to know the steps that Delivery Manager takes to compose a create-tables script.
You can customise the output to your requirements by influencing Step 4 explained in this help topic.
Do this by adding, to your release task, after the step that lets Delivery Manager generate the create-tables script, additional steps that apply XSLT transformations of your own. You can do this by calling, in these steps, the Apply custom XSL action.
IMPORTANT: To be forward-compatible with future versions of Delivery Manager, make sure that you customise only aspects of the input XML, NOT the XSLT transformation itself.
If you have a top-level application TOPAPP, Delivery Manager generates a metadata file called "TOPAPP.USD.xml" that contains all the metadata information in TOPAPP including interface tables with consumed modules.
However, for create-tables, you also need information about tables from consumed modules that are NOT interface tables. If you have 2 consumed modules MOD1 and MOD2, Delivery Manager merges this information into a new file called "TOPAPP.USD.db.xml":
|
In preparation for generating the create-tables script, Delivery Manager creates 2 abstracts, one of the metadata information in the "TOPAPP.USD.db.xml" file that belongs to the previous release, and another of the metadata information in the "TOPAPP.USD.db.xml" file that belongs to the current release.
An abstract is a metadata file from which all metadata information is filtered out that is not relevant for creating a create-tables script.
The 2 abstracts are placed in the \scripts\using directory for the current release. The segments "old" and "new" in the filenames clearly signpost which is the abstract of the previous situation and which is the abstract of the current situation.
|
The next step is that Delivery Manager compares the abstracts and writes the outcome to a file called "TOPAPP.tables.compared.xml". This is a list of required changes: a list of upgrade instructions to bring the database tables from the previous to the current state:
|
The last step is that Delivery Manager transforms the comparison information from XML to SQL statements. This is implemented in a single XSL transformation called "TOPAPP.create-tables-script.xsl" which takes 4 XML source documents as input and outputs the target SQL file. The 4 input files are the 2 abstracts used earlier for the comparison, the outcome of the comparison itself, and an additional file called "TOPAPP.tables.delivered.xml", which is a copy of application table information stored in Delivery Manager itself.
Technically, the transformation is applied to the abstract of the current state. The remaining 3 source documents are referenced in the top section of the XSLT transformation.
Because all 4 source XML files and the XSLT transformation are externalised by Delivery Manager, Step 4 is where you can customise the generation process by altering some of the input information and then re-applying the transformation.
IMPORTANT: To be forward-compatible with future versions of Delivery Manager, make sure that you customise only aspects of the input XML, NOT the XSLT transformation itself.
|
See also
Create-tables script
|