-
Notifications
You must be signed in to change notification settings - Fork 19
How to migrate from AutoPatch 1.1 to AutoPatch 1.2
AutoPatch 1.2 completely supports AutoPatch 1.0, but you'll need to make some changes if you'd like to take advantage of the new features.
If you have implemented the MigrationTask interface, you'll need to change the implementation to RollbackableMigrationTask. This will require you to implement three new methods. They are up, down and isRollbackSupported. The up method performs the exact same purpose as migrate in MigrationTask. That is, it performs the actual migration. For simplicity, you can implement up with one line to just call migrate. The down method performs a rollback, and the isRollbackSupported method indicates if this task can be rolled back. If this method returns false, then the task will not rollback unless the force flag is set to true.
If you have extended MigrationTaskSupport, there is actually very little to do. The MigrationTaskSupport object already provides a lot of base functionality. By default, MigrationTaskSupport provides the following functionality. First, the class provides a few default implementations. isRollbackSupported returns the value of a boolean variable isRollbackSupported. Note that by default this value is initialized false. Secondly, the class provides a base implementation of down, which simply throws UnsupportedOperationException. The migrate method simply calls up and the up method is a default no op method. To migrate to AutoPatch 1.2, simply do the following: override the up and down methods to perform the migration and rollback and then secondly set isRollBackSupported to true if appropriate. Once you've taken these steps, then your task will be Rollbackable.
- Overview
- Design Requirements
- Basic Design
- Detailed Design
- How to integrate AutoPatch with a web application
- How to integrate AutoPatch with your development cycle
- How to implement a patch
- How to extend AutoPatch with new patch types
- How to rollback patches
- How to migrate from AutoPatch 1.1 to AutoPatch 1.2
- How to Migrate to AutoPatch 1.3