By default Lure creates tables by using the
CREATE TABLE statement in the table source file. In other words Lure does not make use of a patch file. You can override this default behaviour by creating a versioned patch file for the table. Lure will then execute the patch file and not attempt to create the table using the table source file.
To ensure that Lure executes this versioned patch file it is necessary to select the correct version number for the patch file:
To illustrate this let's consider the table with name
DIVISION and Subversion as a source code repository. Firstly we must get the revision when the file
DIVISION.table.lsql was first added to Subversion:
Since the first revision of the file
DIVISION.table.lsql in the repository is
65, it will suffice if the version number of the versioned patch file is set to
64. (If the file has not yet been added to the Subversion repository then use the HEAD revision number.)
I will now create a patch file with name
DIVISION.table.lsql.r64.lpatch and add my custom ”
CREATE TABLE AS SELECT” statement:
Use Lure Patch Test to confirm that the patch file correctly creates the table:
Lure executed the patch file and then verified that the patch file created a table with the correct structure.