RoomDatabase.MigrationContainer
public
static
class
RoomDatabase.MigrationContainer
extends Object
| java.lang.Object
|
| ↳ |
androidx.room.RoomDatabase.MigrationContainer
|
A container to hold migrations. It also allows querying its contents to find migrations
between two versions.
Summary
Public methods |
void
|
addMigrations(Migration... migrations)
Adds the given migrations to the list of available migrations.
|
List<Migration>
|
findMigrationPath(int start, int end)
Finds the list of migrations that should be run to move from start version to
end version.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
MigrationContainer
public MigrationContainer ()
Public methods
addMigrations
public void addMigrations (Migration... migrations)
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 |
migrations |
Migration: List of available migrations.
|
findMigrationPath
public List<Migration> findMigrationPath (int start,
int end)
Finds the list of migrations that should be run to move from start version to
end version.
| Parameters |
start |
int: The current database version |
end |
int: The target database version |
| Returns |
List<Migration> |
An ordered list of Migration objects that should be run to migrate
between the given versions. If a migration path cannot be found, returns null.
|