Readability fixes

This commit is contained in:
Paul Schaub 2019-12-13 11:39:35 +01:00
parent 7f2fe135b3
commit ce1152f0d6
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -29,16 +29,12 @@ public class AndroidPersistenceModule {
@Singleton @Singleton
static ReactiveEntityStore<Persistable> provideDatabase(Application application) { static ReactiveEntityStore<Persistable> provideDatabase(Application application) {
// override onUpgrade to handle migrating to a new version // override onUpgrade to handle migrating to a new version
DatabaseSource source = new DatabaseSource(application, Models.DEFAULT, DatabaseSource source = new DatabaseSource(application, Models.DEFAULT, "mercury_req_db", 1);
"mercury_req_db", 1);
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
// use this in development mode to drop and recreate the tables on every upgrade
source.setTableCreationMode(TableCreationMode.DROP_CREATE); source.setTableCreationMode(TableCreationMode.DROP_CREATE);
} }
Configuration configuration = source.getConfiguration(); Configuration configuration = source.getConfiguration();
ReactiveEntityStore<Persistable> dataStore = ReactiveSupport.toReactiveStore( return ReactiveSupport.toReactiveStore(new EntityDataStore<>(configuration));
new EntityDataStore<>(configuration));
return dataStore;
} }
@Provides @Provides