Program: 33571
Project: 33571
Buggy source:
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  TbaLogger.w("String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion);
  int upgradeTo=oldVersion + 1;
  while (upgradeTo <= newVersion) {
switch (upgradeTo) {
case 14:
      db.execSQL(CREATE_DISTRICTS);
    db.execSQL(CREATE_DISTRICTTEAMS);
  if (!columnExists(db,TABLE_EVENTS,EventsTable.DISTRICT_POINTS)) {
    db.execSQL("String_Node_Str" + TABLE_EVENTS + "String_Node_Str"+ EventsTable.DISTRICT_POINTS+ "String_Node_Str");
  }
break;
case 15:
db.execSQL(CREATE_FAVORITES);
db.execSQL(CREATE_SUBSCRIPTIONS);
break;
case 16:
if (!columnExists(db,TABLE_SUBSCRIPTIONS,SubscriptionsTable.NOTIFICATION_SETTINGS)) {
db.execSQL("String_Node_Str" + TABLE_SUBSCRIPTIONS + "String_Node_Str"+ SubscriptionsTable.NOTIFICATION_SETTINGS+ "String_Node_Str");
}
if (!columnExists(db,TABLE_SUBSCRIPTIONS,SubscriptionsTable.MODEL_ENUM)) {
db.execSQL("String_Node_Str" + TABLE_SUBSCRIPTIONS + "String_Node_Str"+ SubscriptionsTable.MODEL_ENUM+ "String_Node_Str");
}
if (!columnExists(db,TABLE_FAVORITES,FavoritesTable.MODEL_ENUM)) {
db.execSQL("String_Node_Str" + TABLE_FAVORITES + "String_Node_Str"+ FavoritesTable.MODEL_ENUM+ "String_Node_Str");
}
break;
case 17:
if (!columnExists(db,TABLE_DISTRICTS,DistrictsTable.NAME)) {
db.execSQL("String_Node_Str" + TABLE_DISTRICTS + "String_Node_Str"+ DistrictsTable.NAME+ "String_Node_Str");
}
break;
case 18:
if (!columnExists(db,TABLE_EVENTS,EventsTable.SHORTNAME)) {
db.execSQL("String_Node_Str" + TABLE_EVENTS + "String_Node_Str"+ EventsTable.SHORTNAME+ "String_Node_Str");
}
break;
case 20:
db.execSQL(CREATE_NOTIFICATIONS);
break;
case 23:
case 24:
db.execSQL("String_Node_Str" + TABLE_SEARCH_TEAMS);
db.execSQL("String_Node_Str" + TABLE_SEARCH_EVENTS);
onCreate(db);
break;
case 25:
db.execSQL("String_Node_Str" + TABLE_API);
break;
case 28:
db.beginTransaction();
try {
db.execSQL("String_Node_Str" + TABLE_NOTIFICATIONS);
db.execSQL(CREATE_NOTIFICATIONS);
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 29:
db.beginTransaction();
try {
if (!columnExists(db,TABLE_TEAMS,TeamsTable.MOTTO)) {
db.execSQL("String_Node_Str" + TABLE_TEAMS + "String_Node_Str"+ TeamsTable.MOTTO+ "String_Node_Str");
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 30:
db.beginTransaction();
try {
if (!columnExists(db,TABLE_MATCHES,MatchesTable.BREAKDOWN)) {
db.execSQL("String_Node_Str" + TABLE_MATCHES + "String_Node_Str"+ MatchesTable.BREAKDOWN+ "String_Node_Str");
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 31:
String[] tables={TABLE_AWARDS,TABLE_DISTRICTS,TABLE_DISTRICTTEAMS,TABLE_EVENTS,TABLE_EVENTTEAMS,TABLE_MATCHES,TABLE_MEDIAS,TABLE_TEAMS};
db.beginTransaction();
try {
for (int i=0; i < tables.length; i++) {
if (!columnExists(db,tables[i],"String_Node_Str")) {
db.execSQL(String.format("String_Node_Str",tables[i]));
}
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 32:
db.beginTransaction();
String[] tables32={TABLE_EVENTS,TABLE_TEAMS,TABLE_DISTRICTTEAMS,TABLE_EVENTTEAMS,TABLE_MATCHES};
try {
for (int i=0; i < tables32.length; i++) {
db.execSQL("String_Node_Str" + tables32[i]);
}
onCreate(db);
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 33:
db.beginTransaction();
try {
if (!columnExists(db,TABLE_EVENTS,EventsTable.CITY)) {
db.execSQL(String.format("String_Node_Str",TABLE_EVENTS,EventsTable.CITY));
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
}
upgradeTo++;
}
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  TbaLogger.w("String_Node_Str" + oldVersion + "String_Node_Str"+ newVersion);
  int upgradeTo=oldVersion + 1;
  while (upgradeTo <= newVersion) {
switch (upgradeTo) {
case 14:
      db.execSQL(CREATE_DISTRICTS);
    db.execSQL(CREATE_DISTRICTTEAMS);
  if (!columnExists(db,TABLE_EVENTS,EventsTable.DISTRICT_POINTS)) {
    db.execSQL("String_Node_Str" + TABLE_EVENTS + "String_Node_Str"+ EventsTable.DISTRICT_POINTS+ "String_Node_Str");
  }
break;
case 15:
db.execSQL(CREATE_FAVORITES);
db.execSQL(CREATE_SUBSCRIPTIONS);
break;
case 16:
if (!columnExists(db,TABLE_SUBSCRIPTIONS,SubscriptionsTable.NOTIFICATION_SETTINGS)) {
db.execSQL("String_Node_Str" + TABLE_SUBSCRIPTIONS + "String_Node_Str"+ SubscriptionsTable.NOTIFICATION_SETTINGS+ "String_Node_Str");
}
if (!columnExists(db,TABLE_SUBSCRIPTIONS,SubscriptionsTable.MODEL_ENUM)) {
db.execSQL("String_Node_Str" + TABLE_SUBSCRIPTIONS + "String_Node_Str"+ SubscriptionsTable.MODEL_ENUM+ "String_Node_Str");
}
if (!columnExists(db,TABLE_FAVORITES,FavoritesTable.MODEL_ENUM)) {
db.execSQL("String_Node_Str" + TABLE_FAVORITES + "String_Node_Str"+ FavoritesTable.MODEL_ENUM+ "String_Node_Str");
}
break;
case 17:
if (!columnExists(db,TABLE_DISTRICTS,DistrictsTable.NAME)) {
db.execSQL("String_Node_Str" + TABLE_DISTRICTS + "String_Node_Str"+ DistrictsTable.NAME+ "String_Node_Str");
}
break;
case 18:
if (!columnExists(db,TABLE_EVENTS,EventsTable.SHORTNAME)) {
db.execSQL("String_Node_Str" + TABLE_EVENTS + "String_Node_Str"+ EventsTable.SHORTNAME+ "String_Node_Str");
}
break;
case 20:
db.execSQL(CREATE_NOTIFICATIONS);
break;
case 23:
case 24:
db.execSQL("String_Node_Str" + TABLE_SEARCH_TEAMS);
db.execSQL("String_Node_Str" + TABLE_SEARCH_EVENTS);
onCreate(db);
break;
case 25:
db.execSQL("String_Node_Str" + TABLE_API);
break;
case 28:
db.beginTransaction();
try {
db.execSQL("String_Node_Str" + TABLE_NOTIFICATIONS);
db.execSQL(CREATE_NOTIFICATIONS);
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 29:
db.beginTransaction();
try {
if (!columnExists(db,TABLE_TEAMS,TeamsTable.MOTTO)) {
db.execSQL("String_Node_Str" + TABLE_TEAMS + "String_Node_Str"+ TeamsTable.MOTTO+ "String_Node_Str");
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 30:
db.beginTransaction();
try {
if (!columnExists(db,TABLE_MATCHES,MatchesTable.BREAKDOWN)) {
db.execSQL("String_Node_Str" + TABLE_MATCHES + "String_Node_Str"+ MatchesTable.BREAKDOWN+ "String_Node_Str");
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 31:
String[] tables={TABLE_AWARDS,TABLE_DISTRICTS,TABLE_DISTRICTTEAMS,TABLE_EVENTS,TABLE_EVENTTEAMS,TABLE_MATCHES,TABLE_MEDIAS,TABLE_TEAMS};
db.beginTransaction();
try {
for (int i=0; i < tables.length; i++) {
if (!columnExists(db,tables[i],"String_Node_Str")) {
db.execSQL(String.format("String_Node_Str",tables[i]));
}
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 32:
db.beginTransaction();
String[] tables32={TABLE_EVENTS,TABLE_TEAMS,TABLE_DISTRICTTEAMS,TABLE_EVENTTEAMS,TABLE_MATCHES};
try {
for (int i=0; i < tables32.length; i++) {
db.execSQL("String_Node_Str" + tables32[i]);
}
onCreate(db);
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 33:
db.beginTransaction();
try {
if (!columnExists(db,TABLE_EVENTS,EventsTable.CITY)) {
db.execSQL(String.format("String_Node_Str",TABLE_EVENTS,EventsTable.CITY));
}
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
case 34:
db.beginTransaction();
try {
db.execSQL("String_Node_Str" + TABLE_MEDIAS);
db.execSQL(CREATE_MEDIAS);
db.setTransactionSuccessful();
}
  finally {
db.endTransaction();
}
break;
}
upgradeTo++;
}
}