Lure integrates the change history of source code as stored in a version control system, with the patch deployment process.

Consider the table EMPLOYEE in the following diagram:


Deployment Strategy


The table source file EMPLOYEE.table was originally added to the version control system at version 23 and was subsequently updated at versions 37, 91 and 97.

The file system contains the content of the HEAD version of the version control system. This consists of version 97 of file EMPLOYEE.table (the HEAD version) as well as patch files corresponding to versions 23, 37 and 91.

During deployment Lure performs the following steps:

  1. Lure connects to the version control system and gets all older versions of the file EMPLOYEE.table (i.e. versions 23, 37 and 91).
  2. Lure connects to the target database and extracts the source code for the table EMPLOYEE (i.e. the CREATE TABLE statement).
  3. Lure compares all versions of the file EMPLOYEE.table with the table source code until it finds a match.
  4. Lure then installs the corresponding patch file (the patch file with the same version number as the matched version of the file EMPLOYEE.table).
  5. The same steps area repeated from step 2 until the table in the database matches that latest version (HEAD) of file EMPLOYEE.table.

For example, if the source extracted from the target database matches version 37 of file EMPLOYEE.table then Lure will install patch file with name EMPLOYEE.table.patch.r37. Note that Lure will in this case not install the patch file for version 23.

Next Lure will extract the updated table source code from the target database. If the updated source code matches version 91 of the file EMPLOYEE.table then Lure will install patch EMPLOYEE.table.patch.r91 and this should bring the table in line with version 97 of the file EMPLOYEE.table. Lure will confirm this by extracting the source code one last time from the target database and comparing it with the HEAD version of source file EMPLOYEE.table.

Key Advantages

Because Lure extracts the source code of tables from the target database and uses this information to determine what patch files need to be deployed, it offers developers the following advantages :

  • Developers don't have to keep track of what changes have already been deployed to the target database.
  • Lure is completely re-runnable.
  • The same set of source files can be deployed against databases at various different patch levels. (This is useful if you go through several iterations of deployments against your QA database environment and subsequently need to deploy all previous changes to your production database in one deployment.)
  • Even if changes were made to the tables in the target database via another path (non involving Lure) Lure will take this into account and just deploy the remaining changes.

See /wiki/table_patch_file_requirements for additional information about table patch files.