• This demo describes in some detail how and when Lure deploys versioned patch files for tables.

    Consider the case when a column is added to a table.

  • In this demo Subversion will be used as the version control system.

    The current HEAD revision of the Subversion repository is 8.

  • A Lure project already exists for the schema and the exported source code has previously been added to the Subversion repository.

    The source code for the table EMPLOYEE does not yet contain the new column AGE.

  • When Export is executed (from within Lure Stage) Lure updates the table source file to contain the new column.

    Lure also creates a pending patch file. The revision number of the generated patch file is "8" which matches the SVN HEAD revision number.

  • After reviewing and testing the pending patch file, it should be approved before proceeding.

  • The updated table source file and corresponding patch file should now be committed to the Subversion repository.

    The table change is now ready to be deployed to a target database environment.

  • Change the active connect file to point to the target environment (PROD).

    The icon decoration indicates that for the target environment (PROD) an incoming change for table EMPLOYEE is available.

  • When the incoming change is imported Lure automatically determines that the table EMPLOYEE is out of date and that the patch file "EMPLOYEE.table.lsql.r8.lpatch" can be used to bring the table up to date.

    The next five slides describe the steps Lure takes to achieve this.

  • Lure detects a difference between the code in the file EMPLOYEE.table.lsql and the code for table EMPLOYEE as extracted from the database.

  • Lure detects the presence of a versioned patch file (r8) for the table EMPLOYEE and proceeds to determine whether it can be utilized.

  • Lure connects to Subversion and retrieves revision 8 of file EMPLOYEE.table.lsql and determines that it matches the source code for table EMPLOYEE as extracted from the database.

    Because the table in the database matches revision 8 of the source file, patch file "r8" is deemed eligible for execution.

  • Lure executes the eligible patch file (EMPLOYEE.table.lsql.r8.lpatch) which adds the column "AGE" to the table.

  • Again Lure compares the code in file EMPLOYEE.table.lsql with the latest code for the table EMPLOYEE as extracted from the database and determines that they match.

    => Success!

  • Two additional patch files were now added in a similar way, i.e. each time adding another column to the EMPLOYEE table.

  • When the updated source code is imported to the target (PROD) environment Lure correctly determines that patch file "r8" does not need to be executed again, but that both patch files "r10" and "r11" need to be executed in order.

    The next eight slides describe the steps Lure takes to achieve this.

  • Lure detects a difference between the code in the file EMPLOYEE.table.lsql and the code for table EMPLOYEE as extracted from the database

  • Lure detects the presence of three versioned patch files for the table EMPLOYEE (r8,r10,r11) and proceeds to determine whether any can be used to bring the table up to date.

  • Lure connects to Subversion and retrieves the three revisions of the file EMPLOYEE.table.lsql corresponding to the three patch files.

    Lure compares the three source file revisions with the source as extracted from the database and finds that the database source matches revision 10, in other words patch file "r10" can be used to update the table.

  • Lure installs patch file "r10" which adds the column WEIGHT.

  • Again Lure compares the file EMPLOYEE.table.lsql with the latest source for table EMPLOYEE as extracted from the database and finds that they are still different.

    => Deployment not done!

  • Lure iterates through the remaining revisions of the file EMPLOYEE.table.lsql and finds that the table matches revision 11, in other words patch file "r11" can be used to update the table.

  • Lure installs patch file "r11" which adds the column HEIGHT.

  • For the third time Lure compares the file EMPLOYEE.table.lsql with the latest source for table EMPLOYEE as extracted from the database and finds that they match.

    => Success!