-Deprecating database get instance without context.
-Added comments to migrations.
This commit is contained in:
parent
3c314ced0a
commit
4ae81a2de4
2 changed files with 10 additions and 0 deletions
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue