Recent Updates
Announcing AutoPatch 1.2 Beta! Including new functionality allowing you to rollback a patches. Be sure to download it and check out the new features
Get started using AutoPatch
Sometimes it is easiest to see an example of how to use AutoPatch in order to see how best to set it up. We're working on an example, in the meantime, these are the steps we take to set it up:- Download autopatch, and put the jar file (as well as commons-logging and maybe log4j) in your library directory
- Follow the instructions to integrate autopatch with ant
- Make a "patches" directory somewhere in your classpath
- Take the "migration.properties" file from the docs directory and alter it to suit your database environment and the location of the patches directory in your classpath, and put it in your classpath
- Author any sql patch you need in that patches directory, with a name like "patch0001_test_patch.sql"
- When you run the ant target "patchinfo" it should tell you that it found one patch, and the patch needs to be applied
- When you run the ant target "patchdb" it should apply the patch and set your patch level to 1
That's it!
From there, you can add a bunch more SQL patches, you can implement Java-language patches if you want, etc etc.
We typically implement the entire database schema as patches from the ground-up, that way installing the application in new environments is trivial.