SQLiteOpenHelper.OnDowngrade(SQLiteDatabase, Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Called when the database needs to be downgraded.
[Android.Runtime.Register("onDowngrade", "(Landroid/database/sqlite/SQLiteDatabase;II)V", "GetOnDowngrade_Landroid_database_sqlite_SQLiteDatabase_IIHandler")]
public virtual void OnDowngrade (Android.Database.Sqlite.SQLiteDatabase? db, int oldVersion, int newVersion);
[<Android.Runtime.Register("onDowngrade", "(Landroid/database/sqlite/SQLiteDatabase;II)V", "GetOnDowngrade_Landroid_database_sqlite_SQLiteDatabase_IIHandler")>]
abstract member OnDowngrade : Android.Database.Sqlite.SQLiteDatabase * int * int -> unit
override this.OnDowngrade : Android.Database.Sqlite.SQLiteDatabase * int * int -> unit
Parameters
The database.
- oldVersion
- Int32
The old database version.
- newVersion
- Int32
The new database version.
- Attributes
Remarks
Called when the database needs to be downgraded. This is strictly similar to #onUpgrade
method, but is called whenever current version is newer than requested one. However, this method is not abstract, so it is not mandatory for a customer to implement it. If not overridden, default implementation will reject downgrade and throws SQLiteException
This method executes within a transaction. If an exception is thrown, all changes will automatically be rolled back.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.