Skip to content

Instantly share code, notes, and snippets.

@mkorman
Last active February 29, 2016 16:47
Show Gist options
  • Save mkorman/2dd337493181beb02586 to your computer and use it in GitHub Desktop.
Save mkorman/2dd337493181beb02586 to your computer and use it in GitHub Desktop.
global class PostInstallScript implements InstallHandler {
global void onInstall (InstallContext context)
{
// Only initialize package on a fresh install!
if (context.previousVersion == null)
{
InitializePackage();
}
// Migrate data, but only for versions older than 1.2
else if (context.previousVersion().CompareTo(new Version (1,2)) < 0)
{
UpgradeForFeature12();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment