Billing.PurchaseDatabase.DatabaseHelper.OnUpgrade C# (CSharp) Method

OnUpgrade() public method

public OnUpgrade ( Android.Database.Sqlite.SQLiteDatabase db, int oldVersion, int newVersion ) : void
db Android.Database.Sqlite.SQLiteDatabase
oldVersion int
newVersion int
return void
            public override void OnUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
            {
                // Production-quality upgrade code should modify the tables when
                // the database version changes instead of dropping the tables and
                // re-creating them.
                if (newVersion != DATABASE_VERSION)
                {
                    Log.Warn(TAG, "Database upgrade from old: " + oldVersion + " to: " + newVersion);
                    db.ExecSQL("DROP TABLE IF EXISTS " + PURCHASE_HISTORY_TABLE_NAME);
                    db.ExecSQL("DROP TABLE IF EXISTS " + PURCHASED_ITEMS_TABLE_NAME);
                    CreatePurchaseTable(db);
                    return;
                }
            }