belongs to Maven artifact androidx.room:room-runtime:2.0.0-alpha1

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 constructors

RoomDatabase.MigrationContainer()

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

Public constructors

RoomDatabase.MigrationContainer

RoomDatabase.MigrationContainer ()

Public methods

addMigrations

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

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.