Skip to content

Commit

Permalink
Table upgrade was done again with next table version
Browse files Browse the repository at this point in the history
Table should only be upgraded from a previous version.
  • Loading branch information
superthib committed Mar 10, 2014
1 parent a1431ac commit 0879b51
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions generator/res/content_subclass_upgrade.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

if (oldVersion <= %1$d) {
if (oldVersion < %1$d) {
db.execSQL("CREATE TABLE " + TABLE_NAME + "_tmp (" + %2$s%3$s%4$s + ");");

db.execSQL("INSERT INTO " + TABLE_NAME + "_tmp SELECT " + %5$s + ", %6$s FROM " + TABLE_NAME + ";");

db.execSQL("DROP TABLE " + TABLE_NAME + ";");
db.execSQL("ALTER TABLE " + TABLE_NAME + "_tmp RENAME TO " + TABLE_NAME + ";");
oldVersion = %1$d;
}
}

0 comments on commit 0879b51

Please sign in to comment.