-Deprecating database get instance without context.

-Added comments to migrations.
This commit is contained in:
John Zhen Mo 2018-01-17 13:53:32 -08:00
parent 3c314ced0a
commit 4ae81a2de4
2 changed files with 10 additions and 0 deletions

View file

@ -21,10 +21,12 @@ public final class NewPipeDatabase {
databaseInstance = Room
.databaseBuilder(context.getApplicationContext(), AppDatabase.class, DATABASE_NAME)
.addMigrations(MIGRATION_11_12)
.fallbackToDestructiveMigration()
.build();
}
@NonNull
@Deprecated
public static AppDatabase getInstance() {
if (databaseInstance == null) throw new RuntimeException("Database not initialized");