-
Notifications
You must be signed in to change notification settings - Fork 569
SQLiteOpenHelper not calling onUpgrade #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi Alexander-Campbell, There are two things you should check, first verify that you are passing the new version number to the constructor of SQLiteOpenHelper. Note that it won't call the |
Hello, What I have done is call the getWritableDatabase function if this throws an exception, then I call upgradeDatabaseFormatFromVersion1To2 and call again getWritableDatabase, this works but is not the ideal solution. Is there any way to detect the SQLCipher version on a DB before calling the getReadable/WriteableDatabase ? That way I can know more exactly when to call the upgrade procedure. thanks |
Hi Alexander-Campbell, A read request would throw a |
hi all actually when you change the database version on className(Context context){ |
Yes, increasing the version number supplied to the constructor argument of the |
Hello,
I have upgraded my version of SQLCipher from 1.1.0 to 2.0.8, in order to get this to work I require to call upgradeDatabaseFormatFromVersion1To2 on the 1.1.0 DBs. How I have tried to implement this is to increase the DB version and then in the onUpgrade function call the upgradeDatabaseFormatFromVersion1To2 function.
The problem I am having is the onUpgrade function is not being called when I create my SQLiteOpenHelper class. I have check the versions of the DB using getVersion(), they are correct. I have also manually called the upgradeDatabaseFormatFromVersion1To2 function on a 1.1 DB and when I import the DB it works fine.
Any ideas why the onUpgrade is not firing, I thought of function template changes, or maybe the order in which I am calling these functions.
The text was updated successfully, but these errors were encountered: