@ Override public void onUpgrade ( SQLiteDatabase db , int oldVersion , int newVersion ) { try { if ( builder . tableNames == null ) { throw new SQLiteHelperException ( "The array of String tableNames can't be null!!" ) ; } builder . onUpgradeCallback . onUpgrade ( db , oldVersion , newVersion ) ; } catch ( SQLiteHelperException e ) { Log . e ( this . getClass ( ) . toString ( ) , Log . getStackTraceString ( e ) , e ) ; } }
Called when the database needs to be upgraded . The implementation should use this method to drop tables add tables or do anything else it needs to upgrade to the new schema version .