You can save the latest version number in the database table, and then at startup compare this value with the package version number. Get it by doing the following:
NSString* version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
If the current version is larger than the version of the last seen, clean your home and then update the "last seen" version in the database table to the current version of the package.
source share