RoomDatabase.MigrationContainer
-
Cmn
class RoomDatabase.MigrationContainer
-
android
open class RoomDatabase.MigrationContainer
A container to hold migrations. It also allows querying its contents to find migrations between two versions.
Summary
Public constructors |
|
|---|---|
|
android
|
|
|
Cmn
|
|
|
Cmn
|
Public functions |
||
|---|---|---|
Unit |
addMigrations(migrations: List<Migration>)Adds the given migrations to the list of available migrations. |
Cmn
android
|
open Unit |
addMigrations(vararg migrations: Migration)Adds the given migrations to the list of available migrations. |
android
|
Boolean |
Indicates if the given migration is contained within the |
Cmn
android
|
open List<Migration>? |
findMigrationPath(start: Int, end: Int)Finds the list of migrations that should be run to move from |
android
|
Map<Int, Map<Int, Migration>> |
Returns the map of available migrations where the key is the start version of the migration, and the value is a map of (end version -> Migration). |
Cmn
android
|
Public constructors
Public functions
addMigrations
fun addMigrations(migrations: List<Migration>): Unit
Adds the given migrations to the list of available migrations. If 2 migrations have the same start-end versions, the latter migration overrides the previous one.
addMigrations
open fun addMigrations(vararg migrations: Migration): Unit
Adds the given migrations to the list of available migrations. If 2 migrations have the same start-end versions, the latter migration overrides the previous one.
| Parameters | |
|---|---|
vararg migrations: Migration |
List of available migrations. |
contains
fun contains(startVersion: Int, endVersion: Int): Boolean
Indicates if the given migration is contained within the MigrationContainer based on its start-end versions.
| Parameters | |
|---|---|
startVersion: Int |
Start version of the migration. |
endVersion: Int |
End version of the migration |
| Returns | |
|---|---|
Boolean |
True if it contains a migration with the same start-end version, false otherwise. |
findMigrationPath
open fun findMigrationPath(start: Int, end: Int): List<Migration>?
Finds the list of migrations that should be run to move from start version to end version.