-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add table fail on onUpgrade #10
Comments
This is an issue I have as well. |
Is there any update on this? The generator basically has no way of adding new tables in newer versions. |
I may have found a fix: frapontillo@7b49c01 The comparison between the |
Something like that? #3 |
Yeah, but the comparison shouldn't be done against |
Working on it. (sorry work is crazy currently so I don't have a lot of time to work on my open source projects ...) Trying to have a fix by tonight |
Thank you Nicolas ;) |
Great! :D |
Imagine we have a database with current database version 4.
Let's add a table called "Tabs" on database version 5.
The code generated is the following :
The SQLiteOpenHelper with its method getDatabaseLocked detects a new version and then launches "onUpgrade(db, version, mNewVersion);.
Tabs.upgradeTable(db, oldVersion, newVersion); is called, oldVersion=4 and newVersion=5 so the first condition is false and the second is true and we throw an exception. Shouldn't we add a mechanism to force the table creation?
Julien
The text was updated successfully, but these errors were encountered: