AutoMigrationSpec
public interface AutoMigrationSpec
Interface for defining an automatic migration specification for Room databases.
The functions defined in this interface will be called on a background thread from the executor set in Room's builder. It is important to note that the functions are all in a transaction when it is called.
| See also | |
|---|---|
AutoMigration |
Summary
Public methods |
|
|---|---|
default void |
onPostMigrate(@NonNull SQLiteConnection connection)Invoked after the migration is completed. |
default void |
Invoked after the migration is completed. |
Public methods
onPostMigrate
default void onPostMigrate(@NonNull SQLiteConnection connection)
Invoked after the migration is completed.
| Parameters | |
|---|---|
@NonNull SQLiteConnection connection |
The database connection. |
onPostMigrate
default void onPostMigrate(@NonNull SupportSQLiteDatabase db)
Invoked after the migration is completed.
This function is only called when Room is configured without a driver. If a driver is set using androidx.room.RoomDatabase.Builder.setDriver, then only the version that receives a SQLiteConnection is called.
| Parameters | |
|---|---|
@NonNull SupportSQLiteDatabase db |
The SQLite database. |