Last active
February 29, 2016 16:48
-
-
Save mkorman/9047aef73e9ab8e87dcb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global class PostInstallScript implements InstallHandler { | |
global void onInstall (InstallContext context) | |
{ | |
// Initialize package (and new feature) on fresh installs | |
if (context.previousVersion() == null) | |
{ | |
InitializePackage(); | |
InitializeFeature13(); | |
} | |
// Migrate data, but only for versions older than 1.2 | |
else if (context.previousVersion().CompareTo(new Version (1,2)) < 0) | |
{ | |
UpgradeForFeature12(); | |
UpgradeForFeature13(); | |
} | |
// Migrate existing data, for versions older than 1.3 | |
else if (context.previousVersion().CompareTo(new Version (1,3)) < 0) | |
{ | |
UpgradeForFeature13(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment